LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timer drift

We are developing a system on Labview to acquire data from several instruments by RS232 and there’s a bug we do not manage to work out. We want a 60s frequency acquisition, but each time the system logs a data string the time loop restarts with some delay, so that after the a few measurements there is a delay of a 1 second. For example :

 

13:43:14          108.21            

13:44:15          108.22            

13:45:15          108.22            

13:46:15          108.22

13:47:16          108.23            

13:48:16          108.23

13:49:16          108.23

13:50:16          108.23                                               

13:51:17          108.23                                   

 

Also, we would like for the system to start logging at a “round” time, for instance XX:XX:00. Is this possible ?

 

Below the section of the block of interest.

Thanks in advance

AVB

0 Kudos
Message 1 of 7
(3,464 Views)
Hi AVB,

can you attach a real picture or (even better!) your vi?

Do you use a timed loop or just simple wait commands? "Wait for next multple" may help too...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,454 Views)
Dear GerdW

Enclosed the VI

Thank you in advance for looking into this

Best regards
Alberto
0 Kudos
Message 3 of 7
(3,439 Views)
Hi Alberto,

the biggest problem is missing synchronization...
You have several parallel running measurements (no problems here). The will be executed in every iteration of the loop. But they will not stop after exactly 60s to allow file saving. That's why you get an time delay - this delay will grow with time...
One possible solution is shown in the attachment: Put the file saving in a separate loop - here no delays will occur...

It's not a perfect solution, just to show general scheme! You should also add some stop button to allow stopping your vi.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(3,421 Views)
Dear GerdW,

Thanks for the vi, we'll test it soon, and I'll keep you posted on this.

Regarding my second query,  do you know how to log the data in the file with a more or less "round" timestamp XX:XX:00 ?

Best regards
Alberto
0 Kudos
Message 5 of 7
(3,415 Views)
Hi Alberto,

two options come to my mind:
1) round off the timestamp by using "%H:%M:00" instead of "%c" when creating the timestamp string Smiley Very Happy

2) use a different wait scheme: wait until seconds=0 in the file-write loop. Use "seconds to Date/Time" the get a "date/time rec", unbundle seconds, compare...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,406 Views)
Hi GerdW

We tested your solutions/suggestions and it works perfect !

Manyn thanks for your help
Best regards
AVB
0 Kudos
Message 7 of 7
(3,387 Views)