Example Code

Binary vs TDMS Benchmarking 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 example streams an identical data set to a directory of your choosing to get an idea of how binary and TDMS streaming rates compare on your system.

 
Description
This VI is ONLY intended as a guideline.  It is by no means an end-all benchmark, but it may give you an idea of the types of streaming rates you could expect in other applications.  Of course, you should always benchmark your end applications to ensure that you are meeting your streaming requirements.

This example has the option to toggle whether you use buffered or unbuffered writes, and it also compares the streaming rates over a range of write block sizes.  For example, the default configuration of the VI will repeatedly stream 1 GB of data to a binary file and then to a TDMS file in block sizes ranging from ~1 kB to ~1 MB.  This experiment may help you determine an optimal block size for streaming to disk.

 

Requirements

Software:

LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Open the VI
  2. Select a directory to which you want to stream
  3. Run the VI (it may take several minutes to complete execution)
  4. Observe the results that are plotted to the front panel

 

Additional Information or References
VI Block Diagram  1.png

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

David R
Systems Engineer
National Instruments

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