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 the wait and the other code, the
'Waits' wait while the rest of the code is executing.

Ed



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 with MADS on the way the Wait function works. Maybe an
App Eng can chime in on this to set us all straight.

Ed



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 everything run
if the target ms has been reached already.

If you could post a picture of the code or the code itself I'm sure we
can find a solution/explanation.



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 
rest inside the diagram, assuming that other code is not some 
synchronous operation (non-reentrant Call Library Node, UI execution 
system VI).

Rolf K