04-14-2026 04:04 PM
Hey everyone, was hoping someone could answer the following:
In the Get Queue Status, does it Dequeue everything as if it were a Flush Queue thus requiring a TRUE be wired to return elements? I was told that is not how it works. If that's not what's meant by "return elements?" then what does that input do?
Solved! Go to Solution.
04-14-2026 04:30 PM
The answer is within reach, with a very small amount of effort:
04-14-2026 10:01 PM
@aputman wrote:
The answer is within reach, with a very small amount of effort:
Well, that's on me. I only read the "return elements?" portion because I wasn't concerned about the other outputs. But you got to admit, it's worded very poorly and named poorly too. Anyways, thank you. Now I understand the naming.
04-15-2026 08:46 AM
@LuminaryKnight wrote:
But you got to admit, it's worded very poorly and named poorly too.
I disagree. It's a "Get Status" VI. If you want the status of the items in the queue, return the elements and examine them. If you want to flush the queue, you wouldn't use a Get Status VI, you would use the Flush Queue VI (which, by the way, also returns the elements). I don't see the issue.
04-15-2026 09:20 AM - edited 04-15-2026 09:22 AM
In addition to what aputman writes, you want to be careful about setting the return elements? to true if you are concerned about performance.
Queues are in principle high performance elements, when you pass an element to the Enque function it will inherit that element, not create a copy of it (unless of course you branch the incoming wire to something else too that consumes that data as well).
Same about Dequeing elements. The element will be removed from the queue and returned without any need to copy its content. With the Get Status function configured to return the elements, the elements can not be cleared from the queue as they are still needed for later dequeing. So this function will need to copy each returned element. This is completely unimportant if your queue element is an integer or other scalar element but starts to get very important if they contain (long) strings or arrays.
So beware!
I use the Get Status normally only to find out if there is any data in the queue and possibly how many elements, never to peek at the data elements.