Example Code

write New Data to Spreadsheet (.csv) and Display 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 Report Generation Toolkit

Code and Documents

Attachment

Description

Overview
This example will read a .csv file and display it in an array indicator.


Description
This example shows how you can use the read from spreadsheet file to pull data from a spreadsheet. In order to directly read Microsoft Excel files we need to use the Report Generation Toolkit (examples in Help»Find Examples), but in excel you can save a spreasheet at a Comma Seperated Value file (CSV) and you can read that using the Read from spreasheet VI.

While this example will not necessarily work for all formats of spreadsheets, it demonstrates the usage of the delimiter and should be a good starting point to build an application.

 
Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. First save your spreadsheet as a csv file
  2. Open “Read From Spreadsheet 2012 NIVerified.vi”
  3. Set the path to your csv file
  4. Set the My File has Row Headers switch
  1. Run the program

 

Additional Information or References
VI Block Diagram

 5-101.png

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

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