LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does LV have async timers

Which is not affected by other windows actions like moving the mouse,
highlighting the title bar, menu buttons etc. And doesn't take too much CPU
utilization. Windows has the multimedia timer for this. Can I access it
through LV?

Also in while loops should I use Wait or Wait Till Next M/sec.? Which one is
better.


visi
0 Kudos
Message 1 of 5
(3,172 Views)
Actually, the standard wait function built into LV is as close to being impervious to operator actions as Windows allows.

In terms of your other question, your choice depends on what you want to do. The Wait Till Next Msec waits until the next N msec increment. The Wait function just waits a set period of time.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,172 Views)
So both wait and wait till next give processor time to execute other
functions?

Reason I asked was that in some LV examples I see wait used explicitly in
while loops with a comment that "we are using wait so other code can run" or
something like that. If while loop was separate thread then it should not
matter. I need to re-read the LV theading options. Maybe by default, GUI
runs in same thread.


vishi


"mikeporter" wrote in message
news:506500000005000000C5EE0000-1042324653000@exchange.ni.com...
> Actually, the standard wait function built into LV is as close to
> being impervious to operator actions as Windows allows.
>
> In terms of your other question, your choice depends on what you want
> to do. The Wait Till Next Msec waits until
the next N msec increment.
> The Wait function just waits a set period of time.
>
> Mike...
0 Kudos
Message 3 of 5
(3,171 Views)
The difference between the two is admittedly subtle, but the Wait always waits the same amount no matter what. The other one waits until the next even multiple of the specifed amount of delay. Hence, the first time through a loop it might delay significantly less than the specified amount of time.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(3,171 Views)
"...in some LV examples I see wait used explicitly in
while loops with a comment that "we are using wait so other code can run""

Wait will give time for other things to execute yes. The reason why a wait often is used in loops is that if the code within the loop does not contain anything that by itself allows the CPU to do other stuff in-between the loop will run as fast as possible, i.e. using 100% of the CPU. If you are developing on Win9X you might never see that effect (it will use a lot of CPY, but normally not 100%), however on NT/200X such behaviour is allowed and must be taken into account (and should thus be on Win 9X as well if there is a chance the software might be used on NT/200X in the future...).
0 Kudos
Message 5 of 5
(3,171 Views)