LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

removing all queued elements

I have a state machine using a queued 1d array to change states, because there are numerous tests that need to be completed in order. 

My problem is I cannot seem to interrupt the array if the user needs to stop the tests. 

What would be the best way to remove all of the elements of the array and insert my test stop?  The elements have to be purged so that when the new test is started, so the old tests are not started first.




metzler CLAD
0 Kudos
Message 1 of 3
(2,528 Views)

What I generally do is insert your high priority message in the front of the queue. Then have your state machine process that message and take the correct action. If you need to dump all messages from the queue then simply use the Flush Queue VI. If you need to preserve any messages you can look at the queue elements using the Queue Status VI. Search for any messages you want to keep, flush the queue and then requeue the ones you want to be processed.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 3
(2,526 Views)

Are you actually working with queues or just an array?  It is hard to tell from your description.  There is a Flush Queue function to empty a queue if you are really working with queues.

 

If you are using an array that you are maintaining to keep a list of things to do, then you will either need to delete from array, or just build your new item onto an empty array.

0 Kudos
Message 3 of 3
(2,525 Views)