LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Starting/Stopping a polling loop with a user event.

Ok, there is something wrong with using the "timeout" property of your event structure as a means to control the delay of your loop.

If you set the timeout property to something like 200ms, then it will sit there and wait 200ms before executing the rest of your code.  So if, for example, your code takes 20ms to execute your loop will actually be running at about 220ms, not 200ms.  Conversly, using the "Wait (ms)" or similar VIs will execute in parallel to the other code in your loop.  So if you're code takes something like 20ms to execute, and you have a 200ms wait in the loop then your loop will execute at 200ms not 220ms.

See the attached files.

0 Kudos
Message 11 of 12
(583 Views)
I don't really have a problem here.  If the same structure is desired, and it is, then placing a "Wait (ms)" vi in the conditional block with the desired polling rate and wiring a 1 to the event structure timeout works.

Using the timeout to set my polling rate was bothering me when it was first proposed, and now I have a real reason as to why it was bothering me!
0 Kudos
Message 12 of 12
(581 Views)