LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing data from two different acquisition rates into one file

Hi,

 

I'm using a compactRIO, and I have an anemometer outputting data at 4Hz to the serial port on the controller, and I am using a 9237 module to read strain from two channels at 40Hz. I would like to record all this data in one file, but I'm unsure how to have the data points match up with respect to time since they are read at different rates. Basically I have 10 strain data points for every one anemometer data point, but that one data point needs to somehow be associated with the other 10 read in the same amount of time. It would be okay to "extend" the slower data to the 10 strain points, and likewise to the next ten when the anemometer refreshes its values.

 

Thanks for any input!

 

Andrew

0 Kudos
Message 1 of 3
(3,084 Views)

Hi Andrew,

 

In similar situations where data are coming in from different sources at possibly different rates I will typically stream the data into a TDMS  file, (the "s" is for streaming). Each source can be a different group and there are a couple of different ways to include the timing or timestamp information with your readings. Once you have worked with the TDMS functions (in the "File I/O" palette) they are pretty easy and most importantly pretty fast!

 

After the fact I read back the TDMS data and from there can perform whatever logic/"synchronization" actions desired. A well-formatted resultant file can then be saved.

 

This post-processing approach can save time, effort, and resources but, of course, does not give instantaneous results.

 

Cheers,

-Jeff

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

Check out the Queue multi-plexer vi from the examples.  C:\Program Files\National Instruments\LabVIEW 2009\examples\general\queue.llb\Queue Multiplexer.vi

 

If each data acquisition loop enqueues data to one file writing loop the data is writen in order.  Queues are really a good way to multiplex data sources 

Message Edited by Jeff Bohrer on 01-29-2010 09:44 AM

"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 3
(3,053 Views)