12-22-2016 07:06 AM
Hello,
I am trying to develop a VI that measures/records the acquired data (for a controllable interval of time) upon clicking.
Many such data samples need to be stored in a CSV file which can be differentiated from one another. I am able to store multiple data sets, but unable to differentiate them.
Also, at the beginning of the file, there should be a Header that contains information such as the date and time of acquisition, name of the operator, etc. I could use some suggestions for that as well.
I am attaching the VI here to make it easier to understand.
I'd appreciate any help for the same. Thanks in advance.
12-22-2016 08:46 AM
A .csv file is simply a text file with lines of text ("rows") where multiple text entries are separated from each other (into "columns") by a specified character, most commonly a comma (hence the name .csv for "comma-separated values"), although the <Tab> character is also common, and is the default separator for LabVIEW's "Spreadsheet" File VIs.
When a .csv file is written where every row has the same number of columns (requiring that every line has the same number of separator characters, such as the comma), this is often mis-named a "Spreadsheet".
If you want to use LabVIEW's Spreadsheet File I/O functions, but include Header rows as well as a few lines of identifiers, there is no problem doing that. You might even be able to violate the "All lines must have the same number of columns" rule by doing multiple appending writes to a single file (I haven't tried this, myself, but worry about its complexity in reading). To write an Array of Data with a Header, either build the Header as a 1D array (of strings) and put it at the front of your 2D Data array (of strings), or do an "appending" two writes, the first of the 1D header, the second of the 2D Data (which can now be floats or some other type different from the Strings in the Header).
Bob Schor