LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract data points from DAQ signals with specific time interval

I am try to acquire multiples analog signal and save them into an Excel file. DAQmx task has 2 input paramaters Number of Sample (N) and Sample Rate (Sample/s or Hz) to control the DAQ device.  The problem is Labview writes all this N sample to an Excel file while I only would like to set a time between 2 samples should be saved to Excel file.  Manipulating N and Fs does not solve my problem, I cannot use continous sampling as my DAQ does not support this function.

 

Example:

- My current VI:  if N = 100, Fs = 10000, there will be 100 samples saved with time interval between 2 sample is 1ms (N/Fs). DAQ retakes the data with the same parameter until I press STOP

 

- My desired VI: If T = 10s, N = 100, Fs = 10000, then each 10s, Labview only save 1 data point into Excel (1 mins will have 6 data points saved, 2 mins will have 12 data points saved), only until I press STOP . In other words, although N = 100 and Fs = 10000 are the same, they are ingored.

 

 

0 Kudos
Message 1 of 4
(2,213 Views)

I think this is what you're trying to do.

 

single sample.png

 

Let your program tell the hardware when to record a single sample.

 

The elapsed time function will output a true value every ten seconds and reset back to false on the next iteration of the loop until another ten seconds has passed.

 

time interval sample.png

0 Kudos
Message 2 of 4
(2,202 Views)

just wondering if you could tell me the name of the VI thats connected with the case selector ?

0 Kudos
Message 3 of 4
(2,119 Views)

It's called elapsed time.vi. You can find it under timing within the programming functions. It typically looks like this when you first place it on the block diagram.

 

timing.jpg

0 Kudos
Message 4 of 4
(2,106 Views)