Showing results for 
Search instead for 
Did you mean: 

Timed loop accuracy

In a  typical machine control application I had a State Machine inside a 50ms timed loop. Suddenly things went haywire after running fine for two years - the timed l.oop either ran too fast (2ms , 10ms etc)  or too slow ( 100ms or more ) and at random. ( P4 with Win2000 OS and LV7.1 ) I can in fact accept timing errors  in the region of 45 to 55 ms.

The same code on other few PCs ran fine. SO to even be more sure we developed a small VI ( LV8.0) to check if it maintains time as expected. It does so finely on all PCs except the PC fitted on the machine.  A reinstall of the OS and application did not help.

But all other applications MS office run fine on the problematic PC. Question is :

Under this circumstance is it  100% sure that the mother board / CPU on the problematic PC has an issue and  change it ?

Thanks in advance.


PS : When the attached VI is running,  try right clicking on some blank space in the screen. The number of times it misses count will be quite high then.
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 4
1. Is it possible to replace it with a new/faster computer?
2. Don't touch that computer when it is running, it that help?
When I open a big program or move a window, the error will occur.  I guess it is because other program uses the system resources and make the timed-loop delayed.
------- LabVIEW 2009, So Easy, Even a Therapist Can Do It -------
0 Kudos
Message 2 of 4
I remember seeing an issue with timed loops in hyperthreading/multicore machines, maybe it is related?
Try to disable hyperthreading in the bios to see if it makes any difference. Just wildely guessing here.... 😉

LabVIEW Champion. It all comes together in GCentral GCentral
Message 3 of 4
Hi Altenbach,

Thanks for the input and the useful link.

Yes I will now try to do two  things :

1. See the effect of changing the Timed loop to a while loop with a ms delay of  50ms.
2. Check if Hyperthreading is ON and if so, knock it off.

How I wish things were simpler like the DOS days or my favourite microcontroller applications. I always ( almost ) knew  at what point what was happening. Now with a GUI application like  LV and a PCI card there are many instances that I am baffled which happens where. But then as long as it works it  does a great job. 

There is no free lunch  in life. Never.

LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 4 of 4