Example Code

High-Speed Data Acquisition without CVI 8.1 or later

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

  • LabWindows/CVI

Code and Documents

Attachment

Description

 

Introduction

CVI 8.1 introduced the TDM Streaming Library which includes easy-to-use functions to write to TDMS data files.  The TDMS file structure allows you to stream data to disk at a high rate of speed, which is perfect for applications where a large amount of data is being acquired.  However, prior to CVI 8.1, this functionality is not included.  NI has developed a TDM C DLL which can be used by any programming language that can interface with a C DLL to write TDM and TDMS files.  This example shows an example of high-speed data acquisition using the functions provided by this TDM C DLL.

 

 

Steps to Complete

This example uses multithreading and a thread-safe-queue to put the acquisition in one thread and the file writing in a separate thread.

 

simacqandwrite.png

 

 

Additional Notes

Example created using CVI 9.0.1, but can be recreated in earlier versions using the source file and header file.

 

Eric B.
National Instruments

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