LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timed loop inside event structure runs too fast

Hello

 

I've got to get an existing vi working. One big issue is a timed structure which does not work as intended.

 

Now I've built a stripped down version which shows the same behavior (see attachment).

lv_timedloop_example.jpeg

It is a timed loop within an event structure (timeout 1ms) surrounded by a while loop. Pressing start produces an event that runs the timed loop inside the event structure.

The Boolean indicator flashes at 1/2 frequency of the timed loop.

The problem is with Labview 2010 32bit on a 64bit Windows 7 system with 8GB RAM and a i7 processor (Quad core with hyperthreading enabled).

I've saved the vi for version 8.6 and tested it with 8.6 on the same machine. The issue stays the same.

 

When started for the first time, the vi runs as intended. But running the loop for a second time, the timed loop runs at maximum possible speed.

 

It seems, that there has been someone with a similar issue in 2007 (http://forums.ni.com/t5/LabVIEW/timer-loop-runs-too-fast/m-p/584633/highlight/true#M273634) but there is no solution in the thread.

 

kind regards

 

Marco

--
Marco Tedaldi, University of Zurich, CLAD
0 Kudos
Message 1 of 4
(2,943 Views)

Hi Ted,

 

after replacing your TWL with a newly created one your VI works fine... (LV2010, 32bit, WinXP, QuadCore)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,934 Views)

A friend just fund the solution:

 

Set "mode" to: Discard missed Periods" (does not matter which one of these two) and it seems to work.

 

I had removed "discard missed periods". But now it seems, that exactly this is a mistake (even if you also set "ignore original phase") because it seems to try to "catch up" with whatever it thinks it should catch up.

So the first time the loop is run, it resets the timer and everything is fine. The second time (after a short pause) it runs faster because in this short break, it has "missed" some periods.

Must have read the documentation wrong...

 

best

 

Marco

--
Marco Tedaldi, University of Zurich, CLAD
0 Kudos
Message 3 of 4
(2,927 Views)

Thanx... this solves the problem as well. Because it's again created with the default settings ("discard missed periods")...

 

So from now on I know that the "discard missed periods" is a quite important setting!

 

best

 

Marco

--
Marco Tedaldi, University of Zurich, CLAD
0 Kudos
Message 4 of 4
(2,926 Views)