LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Timed Loops using Shared Variables for setting Loop dt.

Any ideas why the attached code does not work as expected...

Problem only if initial 'dt' is set to 0ms and using shared variable. 
If initial 'dt' set to 1ms, or using local variable, problem goes away. 

Either way, after the 1st iteration of the loop, the 'dt' should be reset by the shared variable to a more reasonable delay.
I often do this to avoid any startup delay for loops with longish delay times (although a 1ms delay is probably acceptable ;).

Easy workaround, but the symptom is still disturbing....  Curious if anyone has an explanation.
0 Kudos
Message 1 of 3
(2,855 Views)
I can reproduce the problem. I agree something is terribly wrong here. 😞 It is very hard to understand why the running of the main VI should have any influence on the target VI. The target loop just keeps spinning like crazy even though the dt is programmatically set to 1000 later.
 
 
0 Kudos
Message 2 of 3
(2,853 Views)

Hello WHAVEman & altenbach,

I can reproduce the problem here as well, and I agree that this is not expected behavior. This issue has been reported to R&D (# 42UG5P3Q) for further investigation. A possible workaround is to using separate timing sources for each timed loop using Create Timing Source.vi, such as

Thanks for the feedback!

Message Edited by Charlie S. on 10-31-2006 06:04 PM

Message Edited by Charlie S. on 10-31-2006 06:05 PM

Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 3 of 3
(2,786 Views)