07-05-2012 10:31 AM
Hello,
I am contineously acquiring analog data from 4 channels. I would like to save data (certain number of samples) every time a trigger ( a digital input) is acquired .
What will be the best way to go about doing this?
Any leads or example codes will be highly appreciated.
-Priya
07-05-2012 12:46 PM
Have a case structure that , when the trigger is acquired, will save your data to file.
Open a file outside the Acq. loop. Put the "trigger case" inside the loop.
Can you show the Data Acq. loop you have?
07-11-2012 11:33 AM
Sorry for the delay in replying. I have attached the screen shot of the different loops.
The loop which has the digital trigger is Digital Trig.JPG
The analog data collection is in a different loop (Analog Data Collection. JPG)
I would like to save the data in the format shown in Save Format.JPG
07-11-2012 11:34 AM
Here is the labview code.
07-11-2012 11:41 AM
You don't specify what rate you are collecting and trying to save data at. However, I recommend that you use a parallel task for saving your data. File I/O is slow and if you are trying to collect your data at a reasonable rate you don't want the file access stuff to impact your data collection. When you collect the data post it to a queue for further processing/logging. The logging task will get the data from the queue and then handle formating and writing the data to a file. If you are collecting at a high rate it can be useful to bufer up the formatted data and write it to disk at periodic intervals.
07-11-2012 01:38 PM
Hi,
Can you restate , related to the VI's you have posted, what exactly your question is. I noticed you have a few event structures, and several loops, so it is hard to understand in specifics what you are having trouble with. thanks.