LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

real time data from sensors that need to be saved in csv format

Hi all,

 

I am using LabVIEW to acquire data from sensors (temperature, humidity, pressure etc) using Modbus protocol (rs-485). My data is divided into input and holding register depending on the type of sensor output. I have developed a LabVIEW VI which correctly obtain the sensor values (in terms of input and holding registers). Now I am stuck with how to save the data such that I get one excel file with the header as sensor1, sensor 2 ... (or with sensor ID) and my rows as data acquired in continues time manner? Any help on how to develop a VI, please see the attached picture where I need to save my data from points described by a red circle in the attached picture.

Download All
0 Kudos
Message 1 of 4
(2,623 Views)

Hi satoo,

 

how to save the data such that I get one excel file with the header as sensor1, sensor 2 ...

The term "excel file" is quite undefined, I guess you are talking about a spreadsheet file aka delimited text file aka CSV…

 

Write the header line before your loop into the file using WriteToSpreadsheet File.

Write the data to the same file in the loop using the same function. Read the help for the function to learn hwo to append data to existing files…

check.png

Best regards,
GerdW


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

Hi,

 

Thanks for a quick reply.

 

thanks for correcting me, I mean exactly the spreadsheet like 

 

Do you think 'WriteToSpreadsheet File' will serve my purpose in the present case or 'WriteToMeasurementFile' option in LabVIEW?

 

 

0 Kudos
Message 3 of 4
(2,607 Views)

Hi satoo,

 

I think WriteToSpreadsheetFile (or WriteDelimitedSpreadsheet in recent LabVIEW versions) will be sufficient for your use case…

Best regards,
GerdW


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