LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

conditional stopping event structure

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

Regards
0 Kudos
Message 1 of 7
(5,096 Views)

You can't put an event structure into a case structure. It will run even if you are in the other case.

 

See http://forums.ni.com/t5/LabVIEW/An-event-structure-can-freeze-the-front-panel-even-if-not/m-p/106629...

0 Kudos
Message 2 of 7
(5,089 Views)

 

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

0 Kudos
Message 3 of 7
(5,083 Views)

Dear PCSNF

Can you elaborate a little bit more , or edit the VI

 

regards

Regards
0 Kudos
Message 4 of 7
(5,067 Views)

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

Regards
0 Kudos
Message 5 of 7
(5,066 Views)

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

Regards,

Kyle M.
Applications Engineering
National Instruments
Message 6 of 7
(5,048 Views)

@Snamprogetti wrote:

You can't put an event structure into a case structure. It will run even if you are in the other case.

 

See http://forums.ni.com/t5/LabVIEW/An-event-structure-can-freeze-the-front-panel-even-if-not/m-p/106629...


What then, is a queued state machine? Smiley Wink. 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..

0 Kudos
Message 7 of 7
(5,039 Views)