RT FIFO Read Function
- Updated2025-01-28
- 3 minute(s) read
Reads the oldest element in an RT FIFO.
If no new data exists in the RT FIFO or if the RT FIFO is empty, this function waits for the amount of time specified in timeout in ms for new data. If the value of timeout in ms expires, the function returns the value of element in the element out output and returns TRUE in the empty? output.

Inputs/Outputs
rt fifo
—
rt fifo is a reference to an existing RT FIFO.
element
—
element sets the default return value of an empty RT FIFO. This data type changes to match the type of the default return value you wire.
timeout in ms (0)
—
timeout in ms specifies the time, in milliseconds, that the function waits to receive a new value if the RT FIFO is empty. Wire a -1 to the timeout in ms input to wait indefinitely. The default is 0, which indicates to return immediately.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
rt fifo out
—
rt fifo out is a reference to an existing RT FIFO.
element out
—
element out is the data read from the RT FIFO. If the VI does not read new data, the VI returns the default element.
empty?
—
empty? is set to TRUE if the RT FIFO is empty when you read it and the value of timeout in ms has expired.
error out
—
error out contains error information. This output provides standard error out functionality.
# elements
—
# elements returns the number of elements remaining in the RT FIFO after the read or write operation. |
Examples
Refer to the following example files included with LabVIEW Real-Time Module.
- examples\Real-Time Module\RT Communication\RT FIFO\RT FIFO Communication.lvproj
rt fifo
—
element
—
timeout in ms (0)
—
error in (no error)
—
rt fifo out
—
element out
—
empty?
—
error out
—
# elements
—