Table Of Contents

Reading and Writing Waveforms in the Custom Device Engine

Last Modified: March 24, 2021

Use waveforms in custom devices to publish waveform data or read waveform data from other sources in the VeriStand Engine.

Before you begin, add a waveform to your custom device.
  1. Open your waveform custom device in LabVIEW.
  2. Use the VIs on the Waveform Data palette to open a write session to the waveform in the RT Driver VI of your custom device.
    VI Description
    Get Waveform Data Reference Generates a data reference to a specific waveform. If you want to write multiple waveforms, call this VI once per waveform and build an array of data references.
    Open Waveform Session Opens a write session for one or multiple waveforms. You should specify the delta t (dt), or time interval in seconds between any two points in the signal. For example, the dt of a 10 kHz waveform is 0.0001 seconds.
    Start Waveform(s) Provides a start time (t0) that defines when the first sample is written. Readers of the waveform in the VeriStand Engine and on the host computer will receive this value. If you want to read data from another waveform or from the DAQmx API, the t0 is provided. However, if you want to read waveform data from an FPGA, you must calculate the t0 yourself.
    Write Waveform(s) Writes an array of waveform samples. Call this VI repeatedly as you generate data for the waveform. You can write as much or as little data at a time as you want. If you opened a write session for multiple waveforms, this VI writes to each waveform simultaneously.
    Close Waveform Session Closes the write session.
  3. Use the VIs on the Waveform Data palette to implement a read session from the waveform in the RT Driver VI of your custom device.
    VI Description
    Get Waveform Data Reference

    Generates a data reference to a specific waveform. If you want to read multiple waveforms, call this VI once per waveform and build an array of data references.

    Open Waveform Session

    Opens a read streaming session for one or multiple waveforms.

    Read Waveform(s)

    Returns an array of values from the waveform whenever any waveform source publishes data. Call this VI repeatedly to read data as it is published.

    Close Waveform Session

    Closes the waveform streaming session.

For an example of a custom device that reads and writes waveforms, on a computer with LabVIEW installed, browse to the labview\examples\NI Veristand\Custom Devices\Waveform Analysis and Generation directory and open Waveform Analysis and Generation Custom Device Project.lvproj.
After you have set up your custom device, review the other considerations for reading and writing waveforms in a custom device engine.

Recently Viewed Topics