Example Code

Transfer Waveforms With RT-FIFOs While Preserving Waveform Attributes

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

Overview

This code demonstrates how to transfer waveform data with a RT-FIFO without loosing the waveform attributes. 

 

Description

You can use the RT-FIFO functions of the LabVIEW Real-Time Module to send and receive data deterministically between different parts of your VI. RT-FIFO functions provide a deterministic data transfer method that does not add jitter to a time-critical VI. A RT-FIFO can be used with many data types like bool, integer, double, array and waveform.

If you transfer waveforms with RT-FIFOs, the attributes of the waveform are striped of. This is the intended behaviour of RT-FIFOs:

 

http://zone.ni.com/reference/en-XX/help/370622P-01/lvrtvihelp/rtfifocreate/

 

"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."

 

This VI demonstrates a work-around to the fact RT-FIFO VIs strip out waveform attributes. This is done by passing the waveform attributes to Front Panel elements and add the attributes back to the waveform.

Please keep in mind, that the attributes use the variant data typ. It can add extra jitter to your deterministical loop if you work with the variant data type within such a loop.

 

Requirements

 Software

  • LabVIEW Base 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 VI
  2. Run the VI

 

Additional Information or References

Transfer Waveform Attributes with RT-FIFOs - Front Panel.png
 

Transfer Waveform Attributes with RT-FIFOs - Block Diagram.png

 

**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.**
Mark
NI App Software R&D

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