LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

random time values in saved file

I am reading data from 3 different channels using a DAQmx task as shown in the attached pic. The broken wire in the pic can be ignored since it has been fixed using an index array. In case it is not very clear from the pic, the data are being passed through a producer-consumer loop.

 

When the data get written to a file using the express vi, the time values are completely random.

I am acquiring data for 60 seconds at 200 Hz so I would expect the time steps to be in 5 ms increments. However, in the saved file, I have time values of  0, 0.01563, 0.01563, 0.01563, 0.0625..... and so on.  Several of these values are repeated. The time values eventually reach 60 but I was wondering why the time steps are not equal in size. 

 

 

0 Kudos
Message 1 of 3
(2,859 Views)

1) You really should be aquiring more than one sample at a time.  I would read more like 10 samples at a time (at the 200S/sec, that would be 50ms worth of data)

2) You should read the data as waveforms.  Since you have multiple channels, the output will be an array of waveforms.  You will need to update the data type for the queue to be an array of waveforms.

 

What these steps will do is keep the timing information with the data.  Therefore the logging function can use the actual timing from the acquisition instead of whenever it decided to write the data.

 

If you are logging to a TDMS file, you can make things a lot simpler on yourself by using the DAQmx Configure Logging, which will enable the DAQmx driver to stream the data straight to a TMDS file.  There would be no need for the Producer/Consumer setup.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(2,832 Views)

You probably should do continues hardware timed acquisition.

 

(Why are the queues in shift registers???)

0 Kudos
Message 3 of 3
(2,788 Views)