Example Code

Write New Data in Columns and Save to Spreadsheet File in 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 will take data and save them to a spreadsheet file. Data are written by columns, to the right of previous data. 

 

Description

By default, Write to Spreadsheet File.vi appends new data in rows.

The main purpose of this example is to show how to transpose your data in order to append columns instead of rows. Using this example, if the file already exists and contains data, new data are written to the right of previous data, in columns.

 
Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Replace the 2D Array constant in the block diagram with your data acquisition code (i.e. DAQ Assistant)

  2. Set the file path control on the front panel to the correct path of an existing or new spreadsheet file
  3. Run the VI. Data is saved by columns

 

Additional Information or References

 VI Block DiagramWrite Column Data LV 2012 NI Verified.png

 

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

 

 

 

Kyle A.
National Instruments
Senior Applications Engineer

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

Comments
VanessaWen
Member
Member
on

Is the data recorded in excel spreadsheet?