LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed loop hurries frames

I'm getting some unexpected and undesired behavior from timed loops in LV 8.0.

I run a timed loop with multiple frames, with a loop period of 60s and a "start time" of 30s (30000ms) wired to the output of frame 1.  Frame 3 contains a call to a subvi which takes several minutes, but is only called once or twice a day (at desired times of day).  I have set the loop to "discard missed periods" and "ignore phase" when periods are missed.

I EXPECT that, when the subvi in frame 3 runs, the loop will take much longer than the loop period; the missed periods should be discarded and the loop should begin a new iteration, wait 30s to start frame 2, etc., as usual

I FIND that, in the infrequent cases after the loop takes longer than the loop period (because the subvi takes so long to return), the loop correctly discards missed periods, BUT it ignores the requested 30s start time for frame 2!

to recap:
DESIRED behavior:   start loop --> turn process ON --> wait 30s --> turn process OFF --> *wait 30s (remainder of 60s loop period) --> repeat
*check time here, and run subvi if it's time

ACTUAL behavior after last loop iteration ran longer than period (>60s):
turn process ON --> turn process OFF --> wait for 59+ seconds (remainder of 60s loop period)

timeout and deadline are set to -1, offset/phase to 0.  Is this a bug, or somehow expected behavior?  I guess I can fix this by running a timed sequence within a loop, such that the sequence begins anew and has no knowledge of how long the previous sequence took.  Any other suggestions?

I've included an example VI which shows that the "start time" is not properly respected after the previous loop takes too long.


0 Kudos
Message 1 of 3
(2,810 Views)
I can reproduce the problem under 8.0, however it seems fixed in LabVIEW 8.20. 🙂
0 Kudos
Message 2 of 3
(2,794 Views)
 

This was reported to R&D (# 3XPE10FB) and was fixed in LabVIEW 8.20.  Here is a link to the current evaluation software download for LabVIEW.  If you have an active SSP subscription for LabVIEW, you can activate this evaluation version with your LabVIEW 8.0 serial number.

 
Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
0 Kudos
Message 3 of 3
(2,763 Views)