02-12-2015 09:30 AM
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
02-12-2015 10:19 AM
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.
02-12-2015 10:28 AM
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.
02-12-2015 11:09 AM
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.
02-12-2015 11:10 AM - edited 02-12-2015 11:10 AM
Thanks guys, is this a good way to code, I think it is working.
02-12-2015 12:38 PM
An event structure will process only one event every time it is executed. To handle multiple events, it must be inside a loop.