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.


icon

Inputs/Outputs

  • cfiforn.png rt fifo

    rt fifo is a reference to an existing RT FIFO.

  • cstr.png 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.

  • ci32.png 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.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • ififorn.png rt fifo out

    rt fifo out is a reference to an existing RT FIFO.

  • istr.png 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.

  • ibool.png 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.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • iu32.png # elements

    # elements returns the number of elements remaining in the RT FIFO after the read or write operation.

  • Caution If you read from an RT FIFO of array data type within a high-priority loop, you must wire an array of the correct size and data type to the element input of this function. LabVIEW must allocate memory if you do not wire the element input or if you wire an array of fewer elements than the number of elements in the array you read from the RT FIFO. Because memory allocation causes jitter, you must wire an array of the correct size to the element input to avoid jitter in a high-priority loop.
    Note If you use a Real-Time FIFO to transfer waveform data, the variant element of the waveform does not transfer because variants are variable-sized and therefore incompatible with the Real-Time FIFO.

    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