02-15-2011 02:54 AM
Hi all
Attached is my Vi , I want to stop the event structure in loop 1 , from the loop 2 which is continously running in parallel and getting digital input from a DAQ device.
whats happening is first I am checking the status of teh digital input and then on that I am excuting the true structure. once I am in the True case , an event structure for user operations and a parallel while loop is used to monitor the digital input , what I want to do is as soon as the digital daq input is low again i should be back to my fasle case in the main loop but the loop 1 with event structure is not stopping.
help
regards
02-15-2011 03:15 AM
You can't put an event structure into a case structure. It will run even if you are in the other case.
02-15-2011 03:56 AM
Along with Snamprogetti suggestion,
you could use value signalling property node of boolean 4 to generate an event and stop both the loops.
Regards,
Prashant
02-15-2011 10:37 AM
Dear PCSNF
Can you elaborate a little bit more , or edit the VI
regards
02-15-2011 10:41 AM
Dear snamprogeti
The like you provided talks about npt putting the two event structures in a same loop and configure same event to them . as I am simply want to terminate the loop 1 havin the event structure.
regards
02-15-2011 05:45 PM
The Value Signalling property node is designed to trigger the event case.
If you right click the value you want to have trigger the case (input from daq simulated, maybe), then hit create->property node->Value (signal).
This will trigger the event structure.
Also, It is a good programming practice to put wait timers inside while loops, and to wire stop controls for your loops.
Regards,
Kyle Mozdzyn
Applications Engineering
National Instruments
02-15-2011 07:53 PM - edited 02-15-2011 07:55 PM
@Snamprogetti wrote:
You can't put an event structure into a case structure. It will run even if you are in the other case.
What then, is a queued state machine? . The issue is the event structure still queues your events whether or not you are in your "idle" case. So if you don't promptly return to your idle case, events can back up in the event structure causing your program to act like it's lagging. Setting a busy cursor can help to solve this problem. I felt this should be clarified because a properly set up queued state machine is very powerful. This obviously isn't the solution for the parallel loops here but I thought I should add to your point..