11-01-2022 05:41 PM
Hello dear LabVIEW community.
I'm wondering if somebody can help me with writing several arrays into one file please (without the use of report generation toolkit).
This question builds upon my other question, which Bob Schor - thank you so very much to him - helped me to resolve.
I'm obtaining voltages from 4 sensors with "DAQmx read.vi". Then, I split the data into 4 arrays with "Index array function".
My goal is to save the data from the 4 arrays (arrays represent the 4 sensors). I prefer the data to be saved in one file Excel can read, where each column corresponds to a sensor and has a header with the sensor's name.
Note, that even though I said "I prefer", I really just want to save the data in a way I can read it with Python afterwards (separate .txt files, one .txt files, separate or combined delimited spreadsheets - any will work for me). In other words, if it is difficult to meet my preference, anything will do (except for TDMS and binary).
To achieve my goal I tried a variety of ways. The last one - the most promising one which is used in the attached .vi - combines the 4 arrays into one array using "Build array function". The output of "Build array function" is then fed to the "Write Delimited Spreadsheet.vi".
When I run the program and try to save the data, I get a raw of 4 zeros in the file. I don't know how to resolve that issue.
I probe every array with a waveform and can see non-zero signals fluctuating in time above zero for each array.
The specs are as follows.
Thank you in advance.
Ivan
Solved! Go to Solution.
11-02-2022 12:25 PM
Hi. This "Bob" guy probably gave you "incomplete" advice. Here are a few tips:
So spend a little more time with the Help function for Write Delimited Spreadsheet, learn what an "Array Wire" looks like, learn what a "Cluster" or "Waveform" wire looks like, and know the difference. Whoever this Bob guy is can't do everything, though I suspect he (or maybe she, you never know these days) is trying to teach you something about LabVIEW and how to learn it ...
Anonymous
11-03-2022 04:31 PM
Thank you very much again, Bob!
I have solved the problem. Even though, it doesn't seem like I used all of your suggestions. Thus, I couldn't make use of the "Append file" option.
My problem was that I didn't use shift registers.
In one run of the while loop, I acquire 1000 samples. I have to store them. Shift register stores them for me.
In the next run, I acquire 1000 more samples and have to add to the ones I had stored before. For that purpose, I use the function "Index array function".
And so on.
Once the while loop is stopped, the data gets transferred to the delimited spreadsheet.
That's how my .vi works and it is attached to the current post.
Ivan
P.S. I didn't manage to create headers for each column in the delimited spreadsheet. And I, already, don't want to mess with it. I'm leaving it as is.