LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data

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

 

0 Kudos
Message 1 of 6
(2,741 Views)

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?

-------
Mark Ramsdale
-------
0 Kudos
Message 2 of 6
(2,718 Views)

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

0 Kudos
Message 3 of 6
(2,685 Views)

Here  is the labview code.

Download All
0 Kudos
Message 4 of 6
(2,684 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 6
(2,677 Views)

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.

-------
Mark Ramsdale
-------
0 Kudos
Message 6 of 6
(2,667 Views)