04-24-2015 11:09 PM
It is not at all clear to me what you are doing, and what you want to do. I understand that you have three instruments from which you are sampling data, and (ideally) would like to have the data from all three instruments appear (as columns, I presume) in a single file, possibly a LabVIEW Spreadsheet file, possibly an Excel file.
Several questions need to be answered:
Do you know about the Producer/Consumer design pattern? You could easily set up a Producer loop that produces a single triple of points (one from each instrument) at 10 Hz, puts them on a Queue, and sends them to a Consumer loop that displays the data and optionally sends the data to an independent Consumer loop for storage to a disk file (format of your choosing).
Incidently, purists among us (i, for one) would say that you should not use the word "Excel" if you are talking about LabVIEW's Write to Spreadsheet functions. If you want to write an Excel file, you need to use the Report Generation Toolkit. A .csv file can be read by Excel (and Excel likes to make an icon for it), but this is just a particular form of Text file.
Bob Schor
04-25-2015 06:17 AM
One you can do is, use 'write spreadsheet' function. You can make multiple columns even if your sampling rates are different.
When ever the event of measurement is encountered, call your file, read it, search for last array element, insert data in specific column at very last index, pass empty data in other columns and write same spreadsheet again without keeping previous data.
It is not actually preferred method, but if time stamp with data are not the issue, and only data is required, you can use this. You will loose time stamp and hense sampling rate.
Also, you can write timestamp (two columns at a time, one for time stamp and one for data) in the spreadsheet.
Personally, I do not suggest you this method, but it is possible.
Regards,
DCKAN
04-25-2015 08:03 AM - edited 04-25-2015 08:05 AM
I am surprised that no one has given the obvious answer for saving your data - TDMS files. The were designed for saving data in an organized way. Once all the data is saved, if you don't like the structure you can read the file and resave it however you like.
Mike...
04-25-2015 11:13 AM
@mikeporter wrote:
I am surprised that no one has given the obvious answer for saving your data - TDMS files.
Especially since you are using DAQmx. There is a function called DAQmx Configure Logging. You use that before you run your task and the data is automagically saved in a TDMS file. You do not need to do any more work.
Now back to the VI. You only need to set up the task once before your loop. You are currently doing this with every loop iteration. Likewise, you only need to clear the task once after the loop. You can then read the data inside the loop as much as you want.
04-26-2015 01:16 PM
Wait a minute -- the original poster, Parissa_wall3, asked a question about writing data from three instruments into a single data file. Then Ankush appears to have "hijacked" the thread by asking a completely different (but possibly related) question. Are we all answering Parissa_wall3 (I know I am trying to do so)?
Parissa_wall3 -- if you are still following this thread, please respond and let us know your response to those comments that address your original question, and what, if anything, you have to add to this discussion. If, on the other hand, you are satisfied, you can also say so.
Ankush -- consider posting your question as an Original Post. It will lessen the confusion from simple-minded responders such as I.
Bob Schor
04-27-2015 11:13 AM
Thanks for responses, but my question was for many months ago, and I already made it work by moving all data in an array and write it into an excel file after the task is done.