From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Simple Real-Time FIFO Example for LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW Real-Time Module
  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This VI is meant to serve as a tutorial for learning the basics of LabVIEW Real-Time FIFOs (RT FIFOs).

 

Description

FIFO stands for First In First Out, and is similar to a queue. RT FIFOs are meant to be used for communicating data between a time critical thread and lower priority threads without harming determinism (as in the case of using queues, notifiers, and global variables). This method should be used to transfer data safely from a time-critical loop (thread) to a communication loop (thread) running at normal priority, which can then be used to transfer the data to the host machine without affecting the system determinism.This is just an example of how the functions that come with the LabVIEW Real-Time Module can be used.

 

Requirements

 Software

  • LabVIEW Full or Professional Development System 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible)

 Hardware

  • No hardware is necessary to use this example VI

 

Steps to Implement or Execute Code

  1. Download and open the attached file "Simple RT FIFO Demo LV2012 NIVerified.vi"
  2. Follow the instructions in Front Panel and run the program

 

Additional Information or References

Simple RT FIFO Demo LV2012 NIVerified.vi - Front Panel.png

 

Simple RT FIFO Demo LV2012 NIVerified.vi - Block Diagram.png

 

Note: This example does not show how to realize communication between different loops (threads). It's meant to demonstrate simple FIFO properties like having a fixed size which results in overwriting of elements if the FIFO is full. This is important for determinism. This example can be executed under windows and LabVIEW Real-Time targets fulfilling the requirements mentioned above.
 
If you need more detailed information about RT FIFOs and how to realize communication between loops, have a look at the Compact RIO Developers Guide - Chapter 3 - Interprocess Data Communication:
 
**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.