LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

execute an event several time in the code

Hi I would like to execute a piece of code several time in the VI without the need to sub vi calling.

I found a weird reaction from labview as it is executing the event but without respecting the delay.

I realized that when I highlighted the execution.

Cheers,

Zied

0 Kudos
Message 1 of 6
(2,765 Views)

The behavior is not "weird", but exactly as expected.  You write a 'value signaling', which causes an event to be placed in the event queue.  But that event (an no other events) can be processed until the next iteration of the while loop.  You then have a 5-second delay, then write another 'value signaling'.  At that point you have two 'value signaling' events in the event queue.  Although they were placed in the queue 5 seconds apart, that will have no effect on dequeuing them; they will be dequeued as fast as possible.  That's how queues work: The time between the queuing of items is unrelated to the time between dequeuing them.

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 6
(2,752 Views)

If you want it to wait after each sub-vi call, I would recommend placing the wait timer within the subvi, connected to an input.  This way you can allow for variable wait times for each sub-vi call, should the need arise.

Message 3 of 6
(2,742 Views)

Thank you guys, but is it possible to use the event structure but without waiting for the next loop iteration.

I did that, is it a good way to code.

0 Kudos
Message 4 of 6
(2,728 Views)

Thanks guys, is this a good way to code, I think it is working.

0 Kudos
Message 5 of 6
(2,728 Views)

An event structure will process only one event every time it is executed.  To handle multiple events, it must be inside a loop.

"If you weren't supposed to push it, it wouldn't be a button."
Message 6 of 6
(2,713 Views)