Download LabVIEW Real-Time Module User Manual
Transcript
Chapter 3 Building Deterministic Applications Real-Time FIFO VIs Use the Real-Time FIFO VIs to transfer data between VIs in an application. An RT FIFO acts like a fixed queue, where the first value you write to the FIFO is the first value that you can read from the FIFO. RT FIFOs and LabVIEW queues both transfer data from one VI to another. However, unlike a LabVIEW queue, an RT FIFO ensures deterministic behavior by imposing a size restriction on the data. You must define the number and size of the RT FIFO elements. Both a reader and writer can access the data in an RT FIFO at the same time, allowing RT FIFOs to work safely from within a time-critical VI. Use the RTFIFOCreate VI to create a new FIFO or open a reference to a FIFO that you created in another VI. Use the RTFIFORead and RTFIFOWrite VIs to read and write data to the FIFO. Refer to the LabVIEW Help, available by selecting Help»VI, Function, & How-To Help, for VI reference information about the Real-Time FIFO VIs and for information about the data types supported by the Real-Time FIFO VIs. Because of the fixed-size restriction, an RT FIFO can be a lossy communication method. Writing data to an RT FIFO when the FIFO is full overwrites the oldest element. You must read data stored in an RT FIFO before the FIFO is full to ensure the transfer of every element without losing data. Check the overwrite output of the RTFIFOWrite VI to ensure that you did not overwrite data. If the RT FIFO overwrites data, the overwrite output returns a TRUE value. Refer to the examples\ Real-Time\RT Communication.llb for examples of using the Real-Time FIFO VIs to communicate between VIs that run on an RT target. Communicating with Applications on an RT Target The RT Engine on the RT target does not provide a user interface for applications. You can use one of two communication protocols, front panel communication or network communication, to provide a user interface on the host computer for RT target VIs. Real-Time Module User Manual 3-8 ni.com