Elapsed time -seconds issue
Hi,
I am having an issue in trying to provide the right format for this vi, everytime that starts the seconds shows 09 or 07, but then it works fine after the fisrt 10 seconds has passed. Could somebody help me to correct this issue. Thanks vetry much,
Frank
Attachments:
ElapsedTime.zip 29 KB
You can get a more accurate reading, from the first loop iteration using "Get Date/Time in Seconds" as shown.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion
Attachments:
timer.JPG 105 KB
Similar Messages
-
Elapsed time - seconds to string
Hello everyone,
I have what seems to be a simple problem that I can't resolve. In the attached example I wish to convert the elapsed time (s) to a timestamp (h:m:s.ms). The problem is that I can't get the timestamp to start a 00:00:00.000 , it starts at 11:00:00.000. What can I do to get the timestamp to start at an absoulte 0s and not have the hour reset after 24hrs. One of my applications runs for 180hrs.
thanks,
David
Attachments:
Simple Elapsed Time.vi 29 KBI hope I understood you correctly.
You want to have the net time of your program displayed in HH:MMS format but your problem is that the string starts at 11:00 am and that after 23:59 it goes to 00:00. In that case, my suggestion should help. The number will be displayed correctly.
And now, a magic trick...
You live in.......... Australia!
Or somewhere near that time zone. The reason you're seeing 11:00 when you input 0 into the format function is that the internal LV timer starts from 00:00 GMT 01/01/1904. The 11:00 you're seeing is actually in 1904, and that's also the reason the time is reset after 23:59.
You can also use the Get date/time in seconds VI Instead of the ms counter. You won't need to divide by a 1000.
Try to take over the world! -
Write elapsed time to a spreadsheet in hours:minutes:seconds format
Hi everyone,
I've been trying to write an elapsed time to a spreadsheet file in an hours:minutes:seconds format, but the time is displayed in a floating point value of seconds..
how can I write to a spreadsheet in an hours:minutes:seconds format.
Thank you,
James-I often use a subVI that converts Seconds to Hours, Minutes and Seconds. Use the Quotient and Remainder function to divide your elapsed time by 3600, 60 and 1. You can then convert those values to a modified string and use the Write to Spreadsheet File.
As Dennis said, newer versions of LabVIEW's Write to Spreadsheet File.VI can handle arrays of Double, Integer or String automatically, and in older versions, the Write to Spreadsheet File.VI can be modified and copied to handle strings.
Hope this helps.
(Written in 8.5)
Message Edited by LabViewGuruWannabe on 01-18-2008 09:28 PM
Attachments:
TimeToSpreadsheet.vi 26 KB
SecondstoHMS.png 32 KB -
How to get Sum for my Elapse Time string for my group
Hi,
How can I get the sum of an elapse time string in my group footer 2 and group footer 1 from the report screenshot attached.
I have a report that display TimeIn and TimeOut of an employee.
For the total time I have created a formula that will take my time in seconds and displaying it in hrs, minutes and seconds.
How can I get the sum of all the total time per day and display this in my group footer 2.
As well I will need to add the grand total to group footer 1 for the total of days.
The formula I have for the total time is as follow:
WhileReadingRecords;
NumberVar TotalSec := {TimeLogs.TotalTime};
NumberVar Hours := Truncate (Remainder ( TotalSec , 86400) / 3600) ;
NumberVar Minutes := Truncate (Remainder ( TotalSec , 3600) / 60) ;
NumberVar Seconds := Remainder (TotalSec , 60) ;
Totext ( Hours , '00' ) + ':' +
Totext ( Minutes , '00' ) + ':' +
Totext ( Seconds , '00' )
This is a seperate question below but related as well to this report.
Another question I have is how can I round up for example 03:30:58 to 03:31:00
And also how can I round down for example 03:26:10 to 03:26:00
Any help would be appreciated.
Thank you,
JoeHi Jamie,
Well I ran into an issue with this. My Daily Total, there is no issue, it is displaying the proper time. But when I add a summary to my Group Footer 1, it doesn't add up properly.
If I select only 1, 2, or 3 days my Date Range Total is adding fine but when selecting 5 days for example, as you can see from the picture below, for an unknowned reason the total of hrs is wrong.
Do you know why this is happening.
Than you for your help.
Joe
Picture below, this is working fine? -
How to keep Nano showing the elapsed time of song?
Hi,
I'm trying to figure out how to keep the page that shows the elapsed time / time remaining on instead of flipping back to the album artwork in 10 seconds. I need this function. any help would be appreciated.I don't think you can, sorry. But I have emailed Steve and sent feedback to Apple to fix various issues: http://www.apple.com/feedback/ipodnano.html
-
Diffrence between cpu and elapse time in tkprof
Hi All
i found huge diffrence between cpu and elapsed time in tkprof. can you please advice me on this issue.
>call count cpu elapsed disk query current rows
==================================================
Parse 1 0.12 1.36 2 11 0 0
Execute 1 14.30 720.20 46548 190520 205 100
Fetch 0 0.00 0.00 0 0 0 0
======================================================
total 2 14.42 721.56 46550 190531 205 100
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 173 (recursive depth: 1)
Elapsed times include waiting on following events:
Event waited on Times waited Max. Wait Total Waited
===========================================
db file sequential read 46544 0.49 632.12
db file scattered read 1 0.00 0.00
my select statement
SELECT cst.customer_id> ,DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.trx_date) / COUNT(cr.deposit_date))) avgdays
> ,DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.due_date) / COUNT(cr.deposit_date))) avgdayslate
> ,NVL(SUM(DECODE(SIGN(cr.deposit_date - ps.due_date),1, 1, 0)), 0) newlate
> ,NVL(SUM( DECODE(SIGN(cr.deposit_date - ps.due_date),1, 0, 1)), 0) newontime
>
> FROM ar_receivable_applications_all ra
> ,ar_cash_receipts_all cr
> ,ar_payment_schedules_all ps
> ,zz_ar_customer_summary_all cst
> WHERE ra.cash_receipt_id = cr.cash_receipt_id
> AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -12) AND SYSDATE
> AND ra.status = 'APP'
> AND ra.display = 'Y'
> AND ra.applied_payment_schedule_id = ps.payment_schedule_id
> AND ps.customer_id = cst.customer_id
> AND NVL(ps.receipt_confirmed_flag,'Y') = 'Y'
> group by cst.customer_id ;
Thanks,
Anuuser653066 wrote:
Hi All
i found huge diffrence between cpu and elapsed time in tkprof. can you please advice me on this issue.
call count cpu elapsed disk query current rows
================================================================================
Parse 1 0.12 1.36 2 11 0 0
Execute 1 14.30 720.20 46548 190520 205 100
Fetch 0 0.00 0.00 0 0 0 0
================================================================================
total 2 14.42 721.56 46550 190531 205 100
Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 173 (recursive depth: 1)
Elapsed times include waiting on following events:
Event waited on Times waited Max. Wait Total Waited
===========================================================================
db file sequential read 46544 0.49 632.12
db file scattered read 1 0.00 0.00
SELECT cst.customer_id
,DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.trx_date) / COUNT(cr.deposit_date))) avgdays
,DECODE(COUNT(cr.deposit_date), 0, 0, ROUND(SUM(cr.deposit_date - ps.due_date) / COUNT(cr.deposit_date))) avgdayslate
,NVL(SUM(DECODE(SIGN(cr.deposit_date - ps.due_date),1, 1, 0)), 0) newlate
,NVL(SUM( DECODE(SIGN(cr.deposit_date - ps.due_date),1, 0, 1)), 0) newontime
FROM ar_receivable_applications_all ra
,ar_cash_receipts_all cr
,ar_payment_schedules_all ps
,zz_ar_customer_summary_all cst
WHERE ra.cash_receipt_id = cr.cash_receipt_id
AND ra.apply_date BETWEEN ADD_MONTHS(SYSDATE, -12) AND SYSDATE
AND ra.status = 'APP'
AND ra.display = 'Y'
AND ra.applied_payment_schedule_id = ps.payment_schedule_id
AND ps.customer_id = cst.customer_id
AND NVL(ps.receipt_confirmed_flag,'Y') = 'Y'
group by cst.customer_id ; Toon Koppelaars seems to have pinpointed the problem. Where are the 74 seconds unaccounted for seconds (I might have calculated it incorrectly, but I arrived at 88.08 seconds of unaccounted for time: 721.56 total - 1.36 parse - 632.12 db file sequential reads)?
It is interesting that the maximum wait for a single block read reported by TKPROF is 0.49 seconds - this might be an indication of excessive competition for the server's CPU - processes are waiting in the CPU run queue, and therefore not on the CPU. As Toon indicated, 632.12 of the 721.56 seconds were spent waiting for single block reads to complete with 46,544 blocks read. Note also that the query executed at dep=1, and TKPROF may be providing misleading information about what actually happened during those executions. An example of misleading information:
CREATE TABLE T11 (
C1 NUMBER,
C2 VARCHAR2(30));
CREATE TABLE T12 (
C1 NUMBER,
C2 VARCHAR2(30));
CREATE TABLE T13 (
C1 NUMBER,
C2 VARCHAR2(30));
CREATE TABLE T14 (
C1 NUMBER,
C2 VARCHAR2(30));
CREATE OR REPLACE TRIGGER HPM_T11 AFTER
INSERT OR DELETE OR UPDATE OF C1 ON T11
REFERENCING OLD AS OLDDATA NEW AS NEWDATA FOR EACH ROW
BEGIN
IF INSERTING THEN
INSERT INTO T12
SELECT
ROWNUM,
DBMS_RANDOM.STRING('A',25)
FROM
DUAL
CONNECT BY
LEVEL <= 100;
END IF;
END;
CREATE OR REPLACE TRIGGER HPM_T12 AFTER
INSERT OR DELETE OR UPDATE OF C1 ON T12
REFERENCING OLD AS OLDDATA NEW AS NEWDATA FOR EACH ROW
BEGIN
IF INSERTING THEN
INSERT INTO T13
SELECT
ROWNUM,
DBMS_RANDOM.STRING('A',25)
FROM
DUAL
CONNECT BY
LEVEL <= 100;
END IF;
END;
CREATE OR REPLACE TRIGGER HPM_T13 AFTER
INSERT OR DELETE OR UPDATE OF C1 ON T13
REFERENCING OLD AS OLDDATA NEW AS NEWDATA FOR EACH ROW
BEGIN
IF INSERTING THEN
INSERT INTO T14
SELECT
ROWNUM,
DBMS_RANDOM.STRING('A',25)
FROM
DUAL
CONNECT BY
LEVEL <= 100;
END IF;
END;
ALTER SESSION SET TRACEFILE_IDENTIFIER = 'MY_TEST_FIND_ME2';
ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 8';
SET TIMING ON
INSERT INTO T11 VALUES (1,'MY LITTLE TEST CASE');
ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT OFF';The partial TKPROF output:
INSERT INTO T11
VALUES
(1,'MY LITTLE TEST CASE')
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 8 0 0
Execute 1 0.00 0.00 0 9788 29 1
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.00 0.00 0 9796 29 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 56
Rows Row Source Operation
0 LOAD TABLE CONVENTIONAL (cr=9788 pr=7 pw=0 time=0 us)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 1 0.00 0.00
SQL*Net message from client 1 0.00 0.00
SQL ID : 6asaf110fgaqg
INSERT INTO T12 SELECT ROWNUM, DBMS_RANDOM.STRING('A',25) FROM DUAL CONNECT
BY LEVEL <= 100
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.04 0.09 0 2 130 100
Fetch 0 0.00 0.00 0 0 0 0
total 2 0.04 0.09 0 2 130 100
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 56 (recursive depth: 1)
Rows Row Source Operation
0 LOAD TABLE CONVENTIONAL (cr=9754 pr=7 pw=0 time=0 us)
100 COUNT (cr=0 pr=0 pw=0 time=0 us)
100 CONNECT BY WITHOUT FILTERING (cr=0 pr=0 pw=0 time=0 us)
1 FAST DUAL (cr=0 pr=0 pw=0 time=0 us cost=2 size=0 card=1)
SQL ID : db46bkvy509w4
INSERT INTO T13 SELECT ROWNUM, DBMS_RANDOM.STRING('A',25) FROM DUAL CONNECT
BY LEVEL <= 100
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 100 1.31 1.27 0 93 10634 10000
Fetch 0 0.00 0.00 0 0 0 0
total 101 1.31 1.27 0 93 10634 10000
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 56 (recursive depth: 2)
Rows Row Source Operation
0 LOAD TABLE CONVENTIONAL (cr=164 pr=0 pw=0 time=0 us)
100 COUNT (cr=0 pr=0 pw=0 time=0 us)
100 CONNECT BY WITHOUT FILTERING (cr=0 pr=0 pw=0 time=0 us)
1 FAST DUAL (cr=0 pr=0 pw=0 time=0 us cost=2 size=0 card=1)
SQL ID : 6542yyk084rpu
INSERT INTO T14 SELECT ROWNUM, DBMS_RANDOM.STRING('A',25) FROM DUAL CONNECT
BY LEVEL <= 100
call count cpu elapsed disk query current rows
Parse 2 0.00 0.00 0 0 0 0
Execute 10001 41.60 41.84 0 8961 52859 1000000
Fetch 0 0.00 0.00 0 0 0 0
total 10003 41.60 41.84 0 8961 52859 1000000
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 56 (recursive depth: 3)
Rows Row Source Operation
0 LOAD TABLE CONVENTIONAL (cr=2 pr=0 pw=0 time=0 us)
100 COUNT (cr=0 pr=0 pw=0 time=0 us)
100 CONNECT BY WITHOUT FILTERING (cr=0 pr=0 pw=0 time=0 us)
1 FAST DUAL (cr=0 pr=0 pw=0 time=0 us cost=2 size=0 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
log file switch completion 2 0.07 0.07
********************************************************************************In the above note that the "INSERT INTO T11" is reported as completing in 0 seconds, but it actually required roughly 42 seconds - and that would be visible by manually reviewing the resulting trace file. Also note that the log file switch completion wait was not reported for the "INSERT INTO T11" even though it impacted the execution time.
Back to the possibility of CPU starvation causing lost time. Another test with an otherwise idle server, followed by a second test with the same server having 240 other processes fighting for CPU resources (a simulated load).
ALTER SYSTEM FLUSH BUFFER_CACHE;
ALTER SESSION SET TRACEFILE_IDENTIFIER = 'MY_TEST_QUERY_NO_LOAD';
ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER, LEVEL 8';
SET TIMING ON
SELECT
COUNT(*)
FROM
T14;
SELECT
SYSDATE
FROM
DUAL;
SQL> SELECT
2 COUNT(*)
3 FROM
4 T14;
COUNT(*)
1000000
Elapsed: 00:00:01.37With no load the COUNT(*) completed in 1.37 seconds. The TKPROF output looks like this:
SQL ID : gy8nw9xzyg3bj
SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE
NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false')
NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),:"SYS_B_0"),
NVL(SUM(C2),:"SYS_B_1")
FROM
(SELECT /*+ NO_PARALLEL("T14") FULL("T14") NO_PARALLEL_INDEX("T14") */
:"SYS_B_2" AS C1, :"SYS_B_3" AS C2 FROM "T14" SAMPLE BLOCK (:"SYS_B_4" ,
:"SYS_B_5") SEED (:"SYS_B_6") "T14") SAMPLESUB
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.01 0.84 523 172 1 1
total 3 0.01 0.84 523 172 1 1
Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 56 (recursive depth: 1)
Rows Row Source Operation
1 SORT AGGREGATE (cr=172 pr=523 pw=0 time=0 us)
8733 TABLE ACCESS SAMPLE T14 (cr=172 pr=523 pw=0 time=0 us cost=2 size=12 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 3 0.02 0.04
db file parallel read 1 0.31 0.31
db file scattered read 52 0.03 0.47
SQL ID : 96g93hntrzjtr
select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,
sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,
spare1, spare2, avgcln
from
hist_head$ where obj#=:1 and intcol#=:2
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.06 2 2 0 0
total 3 0.00 0.06 2 2 0 0
Misses in library cache during parse: 0
Optimizer mode: RULE
Parsing user id: SYS (recursive depth: 2)
Rows Row Source Operation
0 TABLE ACCESS BY INDEX ROWID HIST_HEAD$ (cr=2 pr=2 pw=0 time=0 us)
0 INDEX RANGE SCAN I_HH_OBJ#_INTCOL# (cr=2 pr=2 pw=0 time=0 us)(object id 413)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 2 0.02 0.04
SELECT
COUNT(*)
FROM
T14
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 1 1 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.03 0.43 6558 6983 0 1
total 4 0.03 0.44 6559 6984 0 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 56
Rows Row Source Operation
1 SORT AGGREGATE (cr=6983 pr=6558 pw=0 time=0 us)
1000000 TABLE ACCESS FULL T14 (cr=6983 pr=6558 pw=0 time=0 us cost=1916 size=0 card=976987)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 1 0.02 0.02
SQL*Net message to client 2 0.00 0.00
db file scattered read 111 0.02 0.38
SQL*Net message from client 2 0.00 0.00Note that TKPROF reported that it only required 0.44 seconds for the query to execute while the SQL*Plus timing indicate that it required 1.37 seconds for the SQL statement to execute. The SQL optimization (parse) with dynamic sampling query accounted for the remaining time, yet TKPROF provided no indication that this was the case.
Now the query with 240 other processes competing for CPU time:
ALTER SYSTEM FLUSH BUFFER_CACHE;
ALTER SESSION SET TRACEFILE_IDENTIFIER = 'MY_TEST_QUERY_WITH_LOAD';
SELECT COUNT(*) FROM T14;
SELECT
SYSDATE
FROM
DUAL;
SQL> SELECT COUNT(*) FROM T14;
COUNT(*)
1000000
Elapsed: 00:00:59.03The query this time required just over 59 seconds. The TKPROF output:
SQL ID : gy8nw9xzyg3bj
SELECT /* OPT_DYN_SAMP */ /*+ ALL_ROWS IGNORE_WHERE_CLAUSE
NO_PARALLEL(SAMPLESUB) opt_param('parallel_execution_enabled', 'false')
NO_PARALLEL_INDEX(SAMPLESUB) NO_SQL_TUNE */ NVL(SUM(C1),:"SYS_B_0"),
NVL(SUM(C2),:"SYS_B_1")
FROM
(SELECT /*+ NO_PARALLEL("T14") FULL("T14") NO_PARALLEL_INDEX("T14") */
:"SYS_B_2" AS C1, :"SYS_B_3" AS C2 FROM "T14" SAMPLE BLOCK (:"SYS_B_4" ,
:"SYS_B_5") SEED (:"SYS_B_6") "T14") SAMPLESUB
call count cpu elapsed disk query current rows
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.28 423 69 0 1
total 3 0.00 0.28 423 69 0 1
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 56 (recursive depth: 1)
Rows Row Source Operation
1 SORT AGGREGATE (cr=69 pr=423 pw=0 time=0 us)
8733 TABLE ACCESS SAMPLE T14 (cr=69 pr=423 pw=0 time=0 us cost=2 size=12 card=1)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file scattered read 54 0.01 0.27
db file sequential read 2 0.00 0.00
SQL ID : 7h04kxpa13w1x
SELECT COUNT(*)
FROM
T14
call count cpu elapsed disk query current rows
Parse 1 0.00 0.03 1 1 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.06 58.71 6551 6983 0 1
total 4 0.06 58.74 6552 6984 0 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 56
Rows Row Source Operation
1 SORT AGGREGATE (cr=6983 pr=6551 pw=0 time=0 us)
1000000 TABLE ACCESS FULL T14 (cr=6983 pr=6551 pw=0 time=0 us cost=1916 size=0 card=976987)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 1 0.02 0.02
SQL*Net message to client 2 0.00 0.00
db file scattered read 110 1.54 58.59
SQL*Net message from client 1 0.00 0.00Note in the above that the max wait for the db file scattered read is 1.54 seconds due to the extra CPU competition - about 3 times longer than your max wait for a single block read. On your database platform with single block reads, it might be possible that the time in the CPU run queue is not always counted in the db file sequential read wait time or the CPU wait time - what if your operating system is slow at returning timing information to the database instance due to CPU saturation - this might explain the 74 (or 88) lost seconds.
Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.
Edited by: Charles Hooper on Aug 28, 2009 10:26 AM
Fixing formatting problems -
Elapsed Time delay only works once in state machine
Hello. I'm having problems using the elapsed time delay to show the seconds remaining on a wait step in a simple state machine. I would like to have a front panel count down showing the time left for the step. I thought the elapsed time delay was the way to do this. The problem is the vi runs correctly the first time through. But then after that the timing does not seem to reset back to the times I had set. If I remove the elapsed time delay and just stick a wait time in the state, the vi runs as I would expect. This just doesn't give the user an idea of the time remaining. What am I missing when using the elapsed time delay, or is this just the wrong tool for the job?
A smaller issue is that I would like to move the tasks, in this case the LED's outside the loop so I don't have to repeat code. But when I tried moving them outside with only leaving the constants inside the state they did not work as I expected. If you have tasks like the operation of a set of booleans that you are used in several states, what is the cleanest way to do this without repeating code?
Thanks for the help.
Danny
Solved!
Go to Solution.
Attachments:
Elapsed Time Delay.vi 39 KBThe problem is that the Auto Reset on the express VI resets the start time of the timer as soon as the time has completed. So you are essentially restarting the #1 timer immediately and then go on to #2. Once #2 is completed, #1 has already passed 10 seconds as well.
What you need to do is use the reset input for the express VI, but only have that be true the first time it is called. By using a shift register and the implies function on those loops, you can do that.
As for the duplication of states, don't have a state 1 and a state 2. Just have a Run state. Use a shift register to maintain a value for what your next state will be and a case structure to based on that to show what booleans should be lit and what the next state will be.
Message Edited by Ravens Fan on 06-12-2009 10:56 AM
Attachments:
Example_VI_BD.png 2 KB -
Elapsed Time in my V$SQL
Hi,
Can someone answer this please?. I'm bit perplexed by the elapsed time in my v$sql
UPDATE ods_router_tables SET last_data_received = :b1, last_data_received_dst = :b3 WHERE
table_name = :b2 AND NVL(last_data_received,TO_DATE('01-JAN-1980','DD-MON-YYYY')) < :b1
Executions: 2786327
Disk reads: 0
Buffer gets: 6023381
Rows processed: 423713
Optimizer cost: 1
Sorts: 0
CPU Time: 898500000
Elapsed Time: 1.84467440681166E19
This table is quite small, only 44 records and if i run the statement in Sql plus, it runs in a
flash. But why this enormous Elapsed time in V$SQL. Is my conversion of this time to
seconds/execution correct?
Elapsed time in seconds/execution: 1.84467440681166E19/1000000/2786327=6620451 seconds!
I guess there is something seriously wrong here. I'm running on a 4 CPU server. DB version is 9.2.
I see similar figures in some of the innocent looking Insert statements as well.
thanks in advance,
SunilELAPSED_TIME in v$sql also includes all wait times for that sql. Is it possible that update is waiting for locks some time? See the following case.
SQL> create table test2 as select * from dual;
Table created.
SQL> update test2 set dummy='A';
1 row updated.From another session try to update the same row.
SQL> update test2 set dummy='B';Wait for some time. Then rollback the first session.
SQL> rollback;
Rollback complete.Now look at v$sql.
SQL> select sql_text,executions,elapsed_time from v$sql where sql_text like 'update%test2%';
SQL_TEXT
EXECUTIONS ELAPSED_TIME
update test2 set dummy='B'
1 29413712
update test2 set dummy='A'
1 2506The first update's elapsed time is very small. The second update's elapsed time is high because of the wait for the lock. -
ORA-1555 ORA-3136 errors:: elapsed time vs Query Duration
Dear all,
- My Database version is 11.2.0.2, Solaris.
- We have been having a problem in the production database where the front end nodes start going up and down for couple of hours sometimes. ; When node flapping is going on we get connection timed out alerts.
WARNING: inbound connection timed out (ORA-3136) opiodr aborting
process unknown ospid (4342) as a result of ORA-609 opiodr aborting
process unknown ospid (4532) as a result of ORA-609 opiodr aborting
process unknown ospid (4534) as a result of ORA-609 opiodr aborting....
Since this week node flapping is happening every day. Since past 2 days after or during node flapping we are getting ORA-1555 error.
Extract from alert log error:
ORA-01555 caused by SQL statement below (SQL ID: g8804k5pkmtyt, Query Duration=19443 sec, SCN: 0x0001.07bd90ed):
SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.parentDeviceId, d.created, d.lastModified AS devLastMod, d.customerId, d.userKey1, d.userKey2, d.userKey4, d
.userKey5, d.firmwareFamily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.userKey6, d.provisioningId, d.status, d.classification, d.population, d.name, d.ipRe
solver, d.ipExpirationTime, d.geoLocationId,contact.firstContactTime, ifaces.id, ifaces.type AS ifaceType, ifaces.lastModified AS ifaceLastMod, ifaces.timeoutname, ifac
es.username1, ifaces.password1, ifaces.username2, ifaces.password2, ifaces.connReqUrl, ifaces.connReqScheme, ifaces.srvNonce, ifaces.deviceNonce, ifaces.phoneNumber,ifa
ces.bootstrapSecMethod, ifaces.srvAuthentication, ifaces.deviceAuthentication, ifaces.userPIN, ifaces.networkID, ifaces.omaSessionID, ifaces.portNum, ifaces.mgtIp, ifac
es.cmtsIp, ifaces.mgtReadCommunity, ifaces.mgtWriteCommunity, ifaces.cmtsReadCommunity, ifaces.cmtsWriteCommunity, devto.name AS devtoName, devto.rebootTimeout, devto.sessionInitiationI run Statspack report from the whole day duration, and looking into the elapsed time in seconds no more than 3739.61 sec (too lower than run duration in the alert log file of 19443 sec); So I would like to know if there is any co-relations between the ORA-3136 errors and the ORA-1555 errors?
CPU CPU per Elapsd Old
Time (s) Executions Exec (s) %Total Time (s) Buffer Gets Hash Value
tTime <= :3 ) AND (endTime IS NULL OR endTime >= :4 )
2773.77 7,787,914 0.00 3.4 3739.61 112,671,645 1909376826
Module: JDBC Thin Client
SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
SQL> show parameter UNDO_MANAGEMENT
NAME TYPE VALUE
undo_management string AUTO
SQL> show parameter UNDO_RETENTION
NAME TYPE VALUE
undo_retention integer 10800BR,
DiegoThank you. Please let me know if it is enough or you need more information;
SQL ordered by Gets DB/Inst: DB01/db01 Snaps: 14835-14846
-> End Buffer Gets Threshold: 100000 Total Buffer Gets: 677,689,568
-> Captured SQL accounts for 73.6% of Total Buffer Gets
-> SQL reported below exceeded 1.0% of Total Buffer Gets
CPU Elapsd Old
Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
21,286,248 2,632,793 8.1 3.4 666.73 666.76 3610154549
Module: JDBC Thin Client
SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
17,029,561 1,176,849 14.5 2.7 417.32 416.73 1909376826
Module: JDBC Thin Client
SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
17,006,795 37 459,643.1 2.7 367.61 368.95 4045552861
Module: JDBC Thin Client
SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.userAnother Statspack report for the whole day shows;
SQL ordered by CPU DB/Inst: DB01/db01 Snaps: 14822-14847
-> Total DB CPU (s): 82,134
-> Captured SQL accounts for 40.9% of Total DB CPU
-> SQL reported below exceeded 1.0% of Total DB CPU
CPU CPU per Elapsd Old
Time (s) Executions Exec (s) %Total Time (s) Buffer Gets Hash Value
tTime <= :3 ) AND (endTime IS NULL OR endTime >= :4 )
2773.77 7,787,914 0.00 3.4 3739.61 112,671,645 1909376826
Module: JDBC Thin Client
SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
SQL ordered by Gets DB/Inst: DB01/db01 Snaps: 14822-14847
-> End Buffer Gets Threshold: 100000 Total Buffer Gets: 1,416,456,340
-> Captured SQL accounts for 55.8% of Total Buffer Gets
-> SQL reported below exceeded 1.0% of Total Buffer Gets
CPU Elapsd Old
Buffer Gets Executions Gets per Exec %Total Time (s) Time (s) Hash Value
86,354,963 7,834,326 11.0 6.3 2557.34 2604.08 906944860
Module: JDBC Thin Client
SELECT d.devId, d.vendor, d.model, d.productClass, d.oui, d.pare
ntDeviceId, d.created, d.lastModified AS devLastMod, d.customerI
d, d.userKey1, d.userKey2, d.userKey4, d.userKey5, d.firmwareFam
ily, d.softwareVer, d.serialNum, d.ip, d.mac, d.userKey3, d.user
.....BR,
Diego
Edited by: 899660 on 27-ene-2012 7:43
Edited by: 899660 on 27-ene-2012 7:45 -
How can I get the elapse time for execution of a Query for a session
Hi ,
How can I get the elapse time for execution of a Query for a session?
Example - I have a report based on the procedure ,when the user execute that it takes say 3 min. to return rows.
Is there any possible way to capture this session info. for this particular execution of query along with it's execution elapse time?
Thanks in advance.Hi
You can use the dbms_utility.get_time tool (gives binary_integer type value).
1/ Initialize you time and date of beginning :
v_beginTime := dbms_utility.get_time ;
2/ Run you procedure...
3/ Get end-time with :
v_endTime := dbms_utility.get_time ;
4/ Thus, calculate elapsed time by difference :
v_elapsTime := v_endTime - v_beginTime ;
This will give you time elapsed in of 100th of seconds...
Then you can format you result to give correct print time.
Hope it will help you.
AL -
How to use elapsed time function with state machine in Lab VIEW
Hello
I've been trying to use state machine with elapsed time function in order to sequentially start and stop my code. The arrangement is to start the code for 1 minute then stop for 5 minutes. I've attached the code, the problem is when I place the elapsed time function out of the while loop it doesn't work, on the other hand when I place it inside the loop it does work but it doesn't give the true signal to move to the next state.
Could you please have a look to my code and help me to solve this issue.
Regards
Rajab
Solved!
Go to Solution.
Attachments:
daq assistance thermocouple(sate machine raj).vi 436 KBRajab84 wrote:
Thanks apok for your help
even with pressing start it keeps running on wait case
could you please explain the code for me, the use of Boolean crossing, increment , and equal functions
Best Regards
Rajab
OK..I modded the example to stop after 2 cycles. Also recommend taking the free online LabVIEW tutorials.
run vi. case statement goes to "initialize", shift registers are initialized to their constants. goto "wait"
"start"= false, stay in current state. If true, transition to "1 min" case
reset elapsed timer with True from shift register(counter starts at zero)."time has elapsed"=false, stay in current state(1 min). If true, goto "5min" case
reset elapsed timer with True from shift register of previous case(counter starts at zero)."time has elapsed"=false, stay in current state(5 min). If true, goto "1min" case. Also, bool crossing is looking for "true-false" from "5 min" compare function to add cycle count.
Once cycle count reaches 2, stop while loop....
Attachments:
Untitled%202[1].vi 42 KB -
Direct Path Read waits are not showing in Elapsed time
Hi,
I'm having a question regarding interpretation of a SQL trace file. I'm on Oracle 11.2.0.1 HP/UX 64 bit.
Following is only the overall result of the trace (it is quite big).
My question is about the Direct Path Read waits which are totallizing 268s of wait but are not showing in the fetch elapsed time (49.58s) and are not showing anywhere in the trace except in the overall result.
I do not understand why it is not part of the Elapsed time...
For info, the trace is for the specific session that was performing all the required queries to display an online report. The database is accessed by the Java application using Hybernate.
The trace was obtained by the following SQL:
exec sys.dbms_monitor.serv_mod_act_trace_enable(service_name=>'SYS$USERS',waits=>true,binds=>true);Then I query the sessions to find the one created by the application.
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 36 0.43 0.51 0 5 0 0
Execute 62 0.01 0.01 0 0 0 0
Fetch 579 4.01 49.06 3027 153553 0 5516
total 677 4.45 49.58 3027 153558 0 5516
Misses in library cache during parse: 29
Misses in library cache during execute: 2
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 32754 0.00 0.03
SQL*Net message from client 32753 2.33 232.01
Disk file operations I/O 179 0.00 0.02
db file sequential read 2979 0.54 45.72
SQL*Net more data to client 133563 0.04 5.30
direct path read 34840 0.94 268.21
SQL*Net more data from client 1075 0.00 0.02
db file scattered read 6 0.03 0.11
asynch descriptor resize 52 0.00 0.00
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 25 0.00 0.02 0 0 0 0
Execute 58 0.05 0.04 0 0 0 0
Fetch 126 0.00 0.04 4 161 0 123
total 209 0.05 0.11 4 161 0 123
Misses in library cache during parse: 3
Misses in library cache during execute: 3
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
Disk file operations I/O 1 0.00 0.00
db file sequential read 4 0.01 0.03
asynch descriptor resize 1 0.00 0.00
37 user SQL statements in session.
57 internal SQL statements in session.
94 SQL statements in session.
Trace file: oxd1ta00_ora_16542.trc
Trace file compatibility: 11.1.0.7
Sort options: default
1 session in tracefile.
37 user SQL statements in trace file.
57 internal SQL statements in trace file.
94 SQL statements in trace file.
57 unique SQL statements in trace file.
241517 lines in trace file.
568 elapsed seconds in trace file.Thanks
ChristopheChristophe Lize wrote:
Closing this thread even if it's not answered...Sorry, I don't have time to test this myself now, but you shouldn't mark this thread as answered if it is not, because other people might find it and think they find an answer if they have a similar question.
I suggest you try the following to narrow down things:
1. Open the RAW trace file and check the cursor numbers of the "direct path reads" - check if you can find any references for those cursor numbers manually. The cursor numbers are those numbers behind the WAIT #<xx>, and you can check if you find any other entry unequal to WAIT #<xx> with the same #<xx>, for example EXEC #<xx> or FETCH #<xx>
A short primer on how to interpret the raw trace file can also be found in MOS document 39817.1
2. Run the RAW trace file through alternative free trace file analyzers like SQLDeveloper (yes it can process raw trace files), OraSRP or Christian Antognini's TVD$XTAT. If you have My Oracle Support access you can also try Oracle's own extended Trace Analyzer (TRCA / TRCANLZR). See MOS Note 224270.1
Check if these tools tell you more about your specific wait event and oddities with the trace file in general.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
Co-author of the "OakTable Expert Oracle Practices" book:
http://www.apress.com/book/view/1430226684
http://www.amazon.com/Expert-Oracle-Practices-Database-Administration/dp/1430226684 -
File adapter - Write - Elapsed Time based batching not working.
We are creating an asynchronous BPEL process that creates a file every 2 mins with the messages the BPEL process received in the last 2 minutes. We are using a file adapter with only "elapsed time" set to 2 minutes (Number of Messages and File size disabled) . If we deploy this into BPEL console and use bpel console's stress test feature, it doesnt create any file at all. If we use a file adapter based on Number of messages, it works fine. Can any one of you suggest what could be the problem ?
Unfortunately, this is documented bahaviour (solution/workaround anyone?!):
Elapsed Time Exceeds:
Specify a time which, when exceeded, causes a new outgoing file to be created.
Note:
The Elapsed Time Exceeds batching criteria is evaluated and a new outgoing file is created, only when an invocation happens.
For example, if you specify that elapsed time exceeds 15 seconds, then the first message that is received is not written out, even after 15 seconds, as batching conditions are not valid. If a second message is received, then batching conditions become valid for the first one, and an output file is created when the elapsed time exceeds 15 seconds. -
When my process stops, I am reading an array of tags(datapoints) and writing the max and average to memory tags for data logging. However, when viewing the data, the elapsed time between cycles spreads the data out unevenly. It could be 90 seconds between cycles or maybe two hours or longer. Is there a way to convert the time axis data to be just consecutive datapoints?? It would be like logging data based on a particular condition happening rather than time-based trending. Should I try to use the data set logger examples instead?? I would prefer to use the built-in datalogging features rather than writing to databases.
You could export your data to a spreadsheet file and then actually write then again in a second database using this example program in the devzone
http://zone.ni.com/devzone/conceptd.nsf/webmain/5A921A403438390F86256B9700809A53?opendocument
Using this program (if you don't want to modify it, which would take a reasonable amount of time specially if you are not familiar with VI-Based Server) You would have to generate a collum in your spreadsheet file to be the timestamp, it would be a artificial timestamp.
What you could do in your application is to first save the data to file and then read from file, substitute the collum timestamp for the "artificial one" and then write it to the database, again, with that you would not need to modify this program.
However if you have the time and is willing to work with VI-based server you could try to modify the example program to be adapted for your purposes.
I hope it helps
Good Luck
Andre Oliveira
Applications Engineer
National Instruments -
What is wrong with this elapsed time counter?
I have been using this simple counter for a while. After unbundling the timestamp - there is always a '19' in the hours indicator. At first I was simply subtracting '19' and it worked fine. Then I ran a program for about 5 hours and the hour display changed to something odd (like a 16 or 17). Any ideas where the '19' comes from?
Thanks - Paul
Attachments:
simple elapsed timer.vi 9 KBOK, typically you don't want to jump through all these hoops and drag along comlex timing fiunctions just to keep elapsed time.
Some simpler suggestions would be (see image):
(A) To place a 1000ms wait inside the loop, then place a simple indicator at the [i] terminal. Set the indicator to relative time format with HH:MMS. Voila!
(B) If you need s, m, h in seperate indicators, just do a few simple calculations
(C) If you don't trust the loop delay, maybe because you do complicated calculations that might take longer than a second in the same loop, Get the elapsed time from the tick count difference.
Message Edited by altenbach on 02-08-2007 04:05 PM
LabVIEW Champion . Do more with less code and in less time .
Attachments:
elapsedTime.png 14 KB
Maybe you are looking for
-
Some the items in the Itunes Library were not copied because they could not be found
I keep getting this error message when I try to sync ringtones to my Iphone 5s. I have 8 total, but 3 of them won't sync over. Itunes says it can't find, them, but I've checked a thousand times that the files are in the Itunes media>Music>Unkown Arti
-
Photoshop templates to dreamweaver
Hello...when I drag the Photoshop template into Dreamweaver, it becomes a jpeg. How can I use a Photoshop template in Dreamweaver and have the capability to change the text and add text over the template?? With the background as a jpeg, I cannot type
-
Every time I take a photo with my I phone it changes orientation when I e-mail it to my computer to post on facebook. Any suggestions?
-
Do you really have to buy snow leopard in store to upgrade to Lion?
I have heard that you DO NOT need to purchase a retail version of Snow Leopard (at the store) to upgrade to Lion. Do you know if this is true? I am on OS 10.5 Leopard. Thanks so much!!!!
-
Script QPAC: how to get a process manager instance?
Hi, I was desperately fiddling about the scripting QPAC, trying to get an instance of process manager. Since PATAbstractServiceEx is an abstract class, I cannot instantiate it and call its getContext().getProcessManager() methods. I also tried to acc