Example Code

Combine Dequeued Waveform Elements in a Producer-Consumer Architecture Using 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

Code and Documents

Attachment

Overview

This VI dequeues a user-defined amount of waveform elements and combines them for easier processing or displaying.

 

Description

This VI uses a producer-consumer architecture. Waveform elements are enqueued in the producer loop. When enough elements are present in the queue, the consumer loop dequeues those elements and combines them. This is done by keeping the first dequeued element's t0 and dt values and the combined Y-array values of all the dequeued elements. The output is a combined waveform of all the dequeued elements, on which further processing can be done. This VI can be useful if the timing for the enqueuing of the waveform data is different from the desired displaying or processing.

 

Requirements

  •  LabVIEW 2012 (or compatible)

Steps to Implement or Execute Code

  1. Download the VI
  2. Open the "Producer-Consumer Combined Waveform 2012.vi"
  3. Set the Producer Loop timing and the number of Samples to combine
  4. Run the VI

Additional Information of References

VI Block Diagram
ProCon.PNG

** This document has been updated to meet the current required format for the NI Code Exchange.**

 

Xavier

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