LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help, Adding value to n-dimension array once and saving data

I use example which comes with labview, "Cont Acq to spreadsheet file.vi" with 3 analog 4-20 mA channels.
I measure time between digital input "start" measure stops when analog input reaches value "n".
How to save my value once to next free column, in this case, column 4 and first row.
I use labview 7.0, thank you
0 Kudos
Message 1 of 4
(2,774 Views)
If you use that canned example, then you cannot do it.
Even if you copy it and modify it, then you cannot put the data where you want it.

Why?

Because you want to write into the first row, but you don't know what value to write there until the last row has already been written.

The only way to get the file the way you want it is to write the spreadsheet file with the example, then open up the file as a text file, and insert the elapsed time where you want it. That means writing the original to a temp file, then creating the final file. Read the first line of the temp file, then append your elapsed time to it, and write it to the final file. Then read the rest of the temp file and write it to the final.

If you could stand it, consider appending the elapsed time as a new row following the last row of data. Considerably easier.

Depending on how much data you are collecting, you could write your own VI to collect it into an array, append the elapsed-time to the array, then write the modified array to a file.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 4
(2,768 Views)
hello, Is there any example how to solve my problem? To write, eg. to 5 th. column and first row.
Thank you for your answer.
0 Kudos
Message 3 of 4
(2,731 Views)
I offered you three ways to solve your problem. If you could tell me why they don't work for you, maybe I could help more.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 4
(2,716 Views)