Creates an RT FIFO or obtains a reference to an existing RT FIFO. The RT FIFO Create function returns a reference to an RT FIFO, rt fifo, that you can use with other Real-Time FIFO functions.


icon

Inputs/Outputs

  • cu32.png elements in array (1)

    elements in array is the number of elements in the array for each RT FIFO element. The default is 1. This input applies only if the RT FIFO elements are arrays. RT FIFOs do not support multi-dimensional arrays.

  • cu32.png size (10)

    size is the number of elements in the RT FIFO. The default is 10.

  • cstr.png name (unnamed)

    name contains the name of the RT FIFO that you want to obtain or create. The default is an empty string name.

  • cfxdt.png type

    type is the type of data that you want the RT FIFO to contain. RT FIFOs do not support data types of variable size, such as clusters, strings, and variants. RT FIFOs also do not support multi-dimensional arrays.

  • cbool.png create if not found? (T)

    create if not found? specifies whether to create a new RT FIFO if the FIFO specified by the name input does not currently exist. If the RT FIFO does not exist and create if not found? is TRUE, the VI creates a new RT FIFO. If the RT FIFO does not exist and create if not found? is FALSE, the VI does not create a new RT FIFO and returns an error.

  • cerrcodeclst.png error in (no error)

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

  • cu32.png datapoints in waveform (1)

    datapoints in waveform is the number of datapoints for every element of the array of waveforms. This input applies only if the RT FIFO elements are waveforms.

  • cnclst.png r/w modes (polling,polling)
    r/w modes specifies the read and write modes for a new RT FIFO. The read and write modes define the way you read a value from an empty FIFO or write a value to a FIFO that does not have an empty slot. An RT FIFO can wait until an empty slot becomes available for a write operation or wait until a value is available for a read operation. You can specify one of the following modes for reads and writes:
    • polling—Use this mode to optimize the throughput performance of read and write operations. The polling mode continually polls the FIFO for new data or an open slot. The polling mode responds quicker than the blocking mode to new data or new empty slots, but requires more CPU overhead. Use the timeout in ms input of the RT FIFO Read or RT FIFO Write function to specify the amount of time that a write operation should poll for an empty slot or the amount of time a read operation should poll for new data. You also can use the overwrite on timeout input of the RT FIFO Write VI to specify whether to overwrite the oldest value in the RT FIFO when the value of the timeout in ms input expires.
    • blocking—Use this mode to optimize the utilization of the CPU during read and write operations. The blocking mode allows the thread of the VI to sleep while it waits, allowing other tasks in the system to execute. Use the timeout in ms input of the RT FIFO Read or RT FIFO Write function to specify an amount of time a read operation can wait for a new value or an amount of time a write operation can wait for an empty slot. You also can use the overwrite on timeout input of the RT FIFO Write VI to specify whether to overwrite the oldest value in the RT FIFO when the value of the timeout in ms input expires.
    If you use the RT FIFO Create function to return a reference to an existing RT FIFO, the reference uses the read and write mode of the existing FIFO and ignores the modes specified with r/w modes.
  • cenum.png read mode

    read mode specifies the read mode for the RT FIFO.

  • cenum.png write mode

    write mode specifies the write mode for the RT FIFO.

  • ififorn.png rt fifo

    rt fifo is a reference to an existing or newly created RT FIFO.

  • ibool.png created new?

    created new? is TRUE if the function created a new RT FIFO.

  • ierrcodeclst.png error out

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

  • For RT FIFOs of array data types, set the elements in array input to the number of elements in each array. For RT FIFOs of waveform data types, set the datapoints in waveform input to the number of datapoints in the waveform. The number of elements in the array or the number of datapoints in the waveform is the same for every element of the RT FIFO.

    You can create a new reference to an existing RT FIFO. To do so, you must specify the same values for name, elements in array, and size as that of the existing RT FIFO. Deleting the reference you create to an existing RT FIFO with the RT FIFO Delete function does not delete the original RT FIFO by default. You can wire TRUE to the force destroy? input of the RT FIFO Delete function to destroy all references to the RT FIFO.

    Note RT FIFOs do not support data types of variable size, such as strings and variants. RT FIFOs also do not support multi-dimensional arrays. If you use an RT FIFO to transfer waveform data, the variant element of the waveform does not transfer because variants are variable-sized and therefore incompatible with the RT 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