From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
To download NI software, including the products shown below, visit ni.com/downloads.
Deprecation notice
This example was written with LabVIEW 2012 and uses the Write to Spreadsheet File.vi which has since been replaced with the Write Delimited Spreadsheet.vi. This example should still run and serve as a tool for learning how to write CSV data with headers. However, if you are building a new application, it is suggested that you update these functions to the supported Write Delimited Spreadsheet.vi function.
Overview
This example shows how to use the Write to Spreadsheet VI to write data to a Comma Separated Value (CSV) spreadsheet file which can be read in Microsoft Excel.
Description
This VI uses the Write to Spreadsheet VI to write a CSV file. The code is separated into four parts. First, the header information is written to the CSV file. Next the channel names are written to the CSV file. Lastly, inside the While Loop, the Random Number (0-1) VI is used to simulate data generation and then these random values are written to the CSV file.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
1. Choose where you would like to store the file
2. Fill out the Header Info array with the header information for your output file.
3. Fill out the Channel Names array with the names of your data channels
4. Determine how many channels of data you want to write and how many values will be written per channel
5. Run the VI
6. Navigate to the file path you provided to see the CSV file the VI created
Additional Information or References
Front Panel
Block Diagram
CSV file in Microsoft Excel
**This document has been updated to meet the current required format for the NI Code Exchange.**
Description-Separate-2
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Very simple and easy to follow. Awesome
yes and on top of easy and nice to follow he describes the entire input, thus gives you an example on how to "include it" inside your vi's
Hueter ,你好!
请问 Header Info 能改成自己编辑的么?
‘’Header Info‘’ can change it into my own?
Expect your answer.
Thank you!
Hello, Why in my CSV file , All Channel are not distributed in new row. All of them are in first row together. Thanks
.
Hello my labview is not seeing some of the Vi's where can I download them?