Example Code

Write Table Row and Column Headers to a Measurement File 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 takes the front panel's Table control and appends its headers before writing to the measurement file.

 

Description

Writing a table control to a measurement file results in only writing the table content. By default, the table row and column headers are not included in the file. This VI takes the front panel's Table control and appends its headers before writing to the measurement file. Thus, both the table headers and the raw data can be found in the file.

 

This VI uses a case structure to write a table control to a measurement file. When the boolean control is set to false (write without headers), a simple Write to Measurement File function uses the table data and writes it to a created Table_Text_File.txt. When the boolean is set to true (write with headers), the table headers are added to the first row and column of the table's array before writing to the file. This is done using the Row Header String and Column Header String property nodes and inserting them into the table array using the Insert into Array function.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Select the desired method of writing(with or without the table headers).
  2. Run the VI.
  3. Examine "Table_Text_File.txt" that was created in the VI directory.

 

Additional Information or References VI Block Diagram

VI Block Diagram

writetable.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.