Dequeue Element Function
- Updated2025-07-30
- 3 minute(s) read
Removes an element from the front of a queue and returns the element.
If the queue is empty, the function waits timeout in ms before timing out, in which case no error is returned and timed out? is TRUE. If an element becomes available in the queue during the wait, the function removes and returns the element and timed out? is FALSE. If queue becomes invalid (for example, the queue reference is released), the function stops waiting and returns error code 1122.

Inputs/Outputs
queue
—
queue is a reference to a queue. Use the Obtain Queue function to obtain a queue reference.
timeout in ms (-1)
—
timeout in ms specifies the time, in milliseconds, that the function waits for an element to become available in the queue if the queue is empty. The default is –1, indicating never to time out. If the function waits timeout in ms and the queue remains empty, timed out? is TRUE.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
queue out
—
queue out returns the reference to the queue unchanged.
element
—
element is the element at the front of the queue. This data type changes to match the subtype of queue.
timed out?
—
timed out? returns TRUE if an element did not become available in the queue before the function timed out. timed out? also returns TRUE if this function encounters an error.
error out
—
error out contains error information. This output provides standard error out functionality. |
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Synchronization\Queue\Queue Overflow and Underflow.vi
queue
—
timeout in ms (-1)
—
error in (no error)
—
queue out
—
element
—
timed out?
—
error out
—