LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dequeue a specified element from a queue

Hi,
 
I would like to dequeue a particular element that is in the middle of a queue. Is it possible?
 
Thanks,
 
ksyz
0 Kudos
Message 1 of 4
(3,138 Views)

This is not really what a queue is for (FIFO, LIFO) but you can always keep popping elements off and either caching them in an array until you get the specific element then pushing the cached element back on the queue or deque and reque elements until you find the specific element.  The second method will not preserve the order however.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 4
(3,137 Views)

Thanks the answer!

As there would be several vi to share a common serial port, a FIFO queue is therefore used. However, I would like the user could end any vi at anytime so that i may need to dequeue a particular element in the middle.

For this purpose, is QUEUE the best choice? or semaphore? (but semaphore seems hard to control.)

Thanks

ksyz

0 Kudos
Message 3 of 4
(3,120 Views)
What does being able to stop a VI at any time have to do with having a common serial port? And what does that have to do with removing an element from the middle of a queue? Please explain your application's architecture.
0 Kudos
Message 4 of 4
(3,110 Views)