Example Code

Write to Multiple Spreadsheets (csv) with Auto Generated File Names and Headers 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 will automatically generate file names, and write a specified number or lines then, create a new file a continue writing.

 

Description

We can think of this VI in 3 sections, Build File Path, Write Header, Write Data. You can easily configure this example to work with DAQmx, just put the DAQmx read where the random number (dice) VI is.

The front panel "File Path String" should include the file name but not the extension.

IE: Fron Panel String = "C:\My LabVIEW\MyData"

This VI will build file paths of MyData1.csv, MyData2.csv, MyData3.csv...

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Configure the parameters on the front panel of this VI.
  2. Run the VI.
  3. Check the CSV files

 

Additional Information or References

VI Snippet of Block Diagram

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