LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

end a queue

Solved!
Go to solution

I emulated the code for this post: http://zone.ni.com/devzone/cda/epd/p/id/1959, however, the vi is an older version of Labview.

 

Most importantly, "Not a queue vi", is no longer available at least in version 2009. So how do I end the while loop once the last element is out.

 

This is the block diagram from the NI site:

 

example queue.jpg

 

While this is my own emulation using version 2009, as you can see, in the while loop there is a function " Not a queue vi", which I can not find in the 2009 version.

 

 

 

my queue.jpg

I even tried wiring the # of elements in queue from the Get queue status vi to "=0", then wired the output to the stop terminal, but got an error.

 

 

 

0 Kudos
Message 1 of 2
(2,665 Views)
Solution
Accepted by topic author ade77

Hi ade,

 

you have to check the error cluster (as you should do anyway in a good program...)! (You picked one of the examples written for LV6 or even older, which should be updated by NI sooner or later...)

 

When you release the queue it's reference get's invalid. The GetQueueStatus function then gives you an error which you can analyze. End your while loop when an error ("invalid reference") occurs...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 2
(2,661 Views)