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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create csv file with multiple channels

Solved!
Go to solution

I am currently writing a program that uses the Keithley 705 scaner and 580 ohm meter. What I need to do is create an excel file that includes a timestamp MM/DD/YYYY HH:MM:SS as one column and then a new column for every channel (1-10 in the case of the keithley 705). Each channel column will contain the resistance reading of that specific channel at the timestamp. The timastamp needs to be when the first scan was executed; for example if we scan channels 1 and 2 their resistance values will be associated with the same timestamp. 

 

My question is how can I format such an excel file.

Download All
Message 1 of 11
(4,486 Views)

LabVIEW project files are actually just xml files containing the project information.  Please attach the actual VIs you have written with your attempts at creating the csv file and we'll be far more able to help you 🙂

0 Kudos
Message 2 of 11
(4,484 Views)

Sorry about that. I think you should only need to view the main VI

0 Kudos
Message 3 of 11
(4,478 Views)

I assume you know that a .csv file is not an "Excel" file.  Excel does know how to open them and arrange them in a spreadsheet, but the cells don't have "Excel" functionality.

 

Do you know about the Write Delimited Spreadsheet function in the File I/O Palette?  Most people who write spreadsheets seem to use this.  [I, myself, prefer to write .xlsx files using the Report Generation Toolkit, but that's another story ...].

 

Bob Schor

0 Kudos
Message 4 of 11
(4,474 Views)

Sorry, yes I do know that a .csv is not an excel file that is just what I have been using. And no I have not heard of the Write Delimited Spreadsheet function. I will look into that.

0 Kudos
Message 5 of 11
(4,468 Views)
Write delimited spreadsheet function will write the data with delimiter separating each values, which takes array of strings or an array of numeric values
Hope this pallets are available in LV 2015
In earlier versions in was with the name "write to spreadsheet file"
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 11
(4,415 Views)
Solution
Accepted by topic author nickemp1996
Answer to your original query
Fix the number of channels (1-10)
Arrange your array value in such a way that it will form first column with time stamp and proceeding with channel values then write into spreadsheet string
You can include header for your values1
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 11
(4,411 Views)

The problem with that is this code will eventaully need to work with 100 channels and literally months of logging values. The array would be too large.

0 Kudos
Message 8 of 11
(4,354 Views)

Hi Nick,

 

no need to collect ALL data in a big array before writing to file!

You can also write chunks of data and append to existing files… (This should be explained in the LaVIEW help for that function!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 11
(4,345 Views)

@nickemp1996 wrote:

The problem with that is this code will eventaully need to work with 100 channels and literally months of logging values. The array would be too large.


I really advice you NOT to use ascii file for such purpose. Learn how to use TDMS files in LAbVIEW, you will see lots of benefits doing so. Moreover TDMS files can be opened directly from Excel using a plugin. Even better, you can easily handle your data using NI DIAdem ( http://www.ni.com/diadem/ )

Some more hints: limit the file size, so after some time you can close the file, and automatically create a new, etc...

 

TDMS files: http://www.ni.com/white-paper/3727/en/

Message 10 of 11
(4,339 Views)