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

NI-HSDIO Stream from Disk: Advanced TDMS

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.

    Hardware

  • Modular Instrumentation

    Software

  • LabVIEW

    Driver

  • Other

Code and Documents

Attachment

Overview
    This example allows a user to stream to an HSDIO device (654x/655x/656x) from disk. The waveform is read from a TDMS file on disk and is written to the device this example.

 

Description
    The following code reads a waveform from a TDMS file and writes it to an HSDIO device’s onboard memory for generation.  In the similar example “niHSDIO Stream from Disk Binary Queues”, queues are required to buffer data between the device and the disk. However, because this example uses TDMS Asynchronous Read, the data is set in a buffer as it leaves the TDMS file rather than in a queue.  From the help file for TDMS Configure Asynchronous Reads VI.


Requirements
    Software
        LabVIEW 2012 (or compatible)
        NI-HSDIO driver which is compatible with your hardware and version of LabVIEW
    Hardware
        HSDIO device (NI 654x/655x/656x)


Instructions

1. Specify the file destination for the acquired waveform.
2. Enter the digital channels of the hardware device to be read in the Channel List control.
3. Specify the clock rate for the Sample clock in the Clock Rate control.
4. Specify the number of samples to acquire in the Samples to Acquire control.

5. Specify the number of samples to transfer from onboard memory to the PC memory at a time in the Fetch Size control. This control also determines the size of buffer to write to the hard drive at a time.

 

Additional Information or References

 

                 

Stream to DISK TDMS.png

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

Customer Education Product Marketing Manager
National Instruments

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