LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple columns when logging data to txt file

Solved!
Go to solution
I'm wanting to write to for example three different columns in a single txt file when data logging. Can someone show me some example code how to get 3 groups of data with multiple points, write them to their own columns and then go back and write more data points to the columns by appending the data....Please and thanks.
0 Kudos
Message 1 of 5
(4,303 Views)

I made something real quick for you. Theres probably a better way to do this, so just mess around with it.

Just replace the numeric controls (numeric, numeric 1, numeric 2)

with the outputs for each of the respective columns.

Cory K
0 Kudos
Message 2 of 5
(4,298 Views)
Solution
Accepted by topic author Tony88a

Hi Tony,

 

here's a basic example to do this.

In newer LV versions you will find a function "write to spreadsheet file" that accomplishes the task of the two functions at the right hand of the block diagram, but the shown version is IMHO more versatile as it allows to add headers and footers easily...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 5
(4,294 Views)

ha its Tonya, thanks.

 

but I also was trying to write to a file when running a while loop. i have a while loop and am continuously pulling data from my DAQ card. I have a case that gets the data and one that makes some calculations, finally saving the manipulated data and going back to do another set of 40,000 data points. If I have the write to file in the case structure it wants a new file every time it comes to that case. If its on the outside how to I store the data until the loop in complete, just put it in an array and keep appending to it until I'm done taking data?

0 Kudos
Message 4 of 5
(4,247 Views)

Hi Tony,

 

have you read the context help for the FileWrite-function? If so you should be able to produce the same example as I attached now Smiley Wink

Best regards,
GerdW


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