03-20-2007 02:39 PM
03-20-2007 03:01 PM
03-20-2007 03:02 PM
The Help is correct, it just fails to mention the different ways Queues work.
In the example you posted, you are opening two references to the same Queue by using the Name terminal on the Obtain Queue function. If you look at the Release Queue function, there is a terminal named "force destroy? (f). Since you opened two references to a single queue, you need to close each of those references for the Queue to be completely released from memory. You can do this by either using multiple Release Queue functions or by connecting a True Boolean constant to the force destroy terminal of a single Release Queue function.
Doing that will completely delete the queue and the Dequeue function will generate the error.
Ed

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.03-20-2007 03:12 PM
OK. I think I'll use the force destroy option. In my actual application I have the loops in separate VIs so I was roughly following the "Queue Messaging Logging" example in opening multiple references with the queue name. Which brings me to a related question: Are there pro/cons to passing the actual queue reference to subVIs as opposed to passing the Queue name and obtaining a new reference? Thanks.
Paul
03-20-2007 03:20 PM
@Phamton wrote:
Are there pro/cons to passing the actual queue reference to subVIs as opposed to passing the Queue name and obtaining a new reference? Thanks.
Paul
Six of one, half dozen of the other.
Passing a single reference around means you only have a single reference to close, but getting a reference to an existing Queue by using names is usually easier. You just have to remember to close each reference individulally or use the Force Destroy option.
I normally use the Named Queues.
Ed

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.