LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

priority in events

Hi there,
when using the event structure is there a way to
interrupt a certain event for a more important one?
For instance the stop button, no matter what the program is doing it should immediately stop.

Thanks
0 Kudos
Message 1 of 6
(2,626 Views)
The abort button will stop the VI immediatly regardless what the VI is doing (tested with the Wait (ms) function). I think this is true even for the Abort VI Method.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 6
(2,626 Views)
Ok so stopping is possible, but what about events with priority settings is that possible?
0 Kudos
Message 3 of 6
(2,626 Views)
I am not sure you can "control" which event goes first when multiple comes in at the same time.

Event should be use to handle simple tasks. Any time intensive / consuming operations should be put into a separate case, or even better a loop, you can put some checks there to skip them should a more important Event is detected.

Joe
0 Kudos
Message 4 of 6
(2,626 Views)
We use a queue to queue up states for a seperate state machine. The event handler only adds states to the queue. I know that it sounds a little awkward, but it has many advantages since you can take things out of the queue or put things in the front of the queue. When it come right down to it, you can also interrupt what's happening in the state machine. This might be an architecture that you could use to re-order how things happen.

Rob
0 Kudos
Message 5 of 6
(2,626 Views)
You cannot prioritize the events handled by the event structure. The events will always be handled in a FIFO like manner. There seems to be no other method than Abort VI to terminate an event.
If you need to reorder the events you have to use your own queue and a state machine to do that. Also long running events need to check a signal like a notifier.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 6 of 6
(2,626 Views)