Wlile loop that takes all the CPU time

2004-04-08 Thread Kyrrnave
Hello, I'm working on a control system that has a main VI with two parallel while loops. My problem is that one of these seem to eat up all the CPU time. Even though I've given it a 500 ms wait, the other loop is simply left out of the loop. (Pun intended). The two while loops are attached (in

Re: Wlile loop that takes all the CPU time

2004-04-08 Thread Les Hammer
It should work. Post some code so we can look for an error. Les

Re: Wlile loop that takes all the CPU time

2004-04-08 Thread Ed Dickens
Just a guess here, but it could be that your code is taking more than 500ms to execute. The 'Wait' would then have no effect. The 'Wait' functions start waiting as soon as they have thier value, not after all the code in the loop has finished executing. So unless there is data dependency between

Re: Wlile loop that takes all the CPU time

2004-04-08 Thread Mads
This is true only if you use the Wait until next ms Multiple, the Wait function on the other hand will always give the CPU it's rest...

Re: Wlile loop that takes all the CPU time

2004-04-08 Thread Ed Dickens
OK, so which way is it. I've read various things over the past couple hours and it seems nobody really knows or can agree what happens here. The KB artical a href=http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/12b2ea9ad5b265ad86256257004dd8e2?OpenDocument;here/a seems to agree

Re: Wlile loop that takes all the CPU time

2004-04-08 Thread Mads
It's kind of in the middle;-) As Rolf says if there is other code that takes all the CPU then sure, the wait included in another code does not help...But for the code that the wait is involved in it will allways ensure a halt, contrary to the wait until next ms which would immediately let

Re: Wlile loop that takes all the CPU time

2004-04-08 Thread Kyrrnave
Thanks for your answers everyone, I'll try out what you suggest, and if that don't help me, I'll see if i can post some code(it's a small part of a big system). Kyrre

Re: Wlile loop that takes all the CPU time

2004-04-08 Thread Rolf
Mads wrote: This is true only if you use the Wait until next ms Multiple, the Wait function on the other hand will always give the CPU it's rest... Not really. As long as there is not data dependancy between the rest of the code and the Wait function the Wait will wait in parallel with the