06-18-2012 12:30 PM
Hello,
I am trying to acquire data from two serial com ports simultaneously.
I have been succesfully set up the com ports and i can access the data from both sources but not in parallel.
More specifically i acquire GPS data from one sensor at 20Hz and i save the data in an array along with a time stamp.
In another VI i acquire the data from another sensor at 1 Hz and i save the data in ana array along with a time stamp.
What i am trying to do is to acquire simultaneously from the two sources along with a time stamp in one array
The problem is that i do not want to wait for the 1Hz source to execute and delay my 20Hz source. The sampling has to be performed at the 20Hz and the 1Hz source samples should be repeated.
Any suggestions on how to do it?
06-18-2012 01:36 PM
One simple approach is to put the measurements in two separate loops. In the faster loop acquire the GPS data and put it in a queue. In the slower loop read the sensor. After every sensor measurement, flush the queue, which will give you all the GPS data since the previous sensor measurement. Then, use the sensor value to initialize an array of the same length as the GPS data.
08-02-2012 11:15 AM
I am interested in a similar situation. I want to sample pressures from two different sections of a shock tube. I want the top driver (filling) section to be sampled at 500Hz and the lower shock tube exit to be sampled at 125kHz. I currently have been only triggering off of and measuring the exit section using a reference trigger. I would still need to have some type of trigger behavior, as the blast event we are recording happens in the range of 30ms.
08-03-2012 02:57 PM
It would depend on how many devices you are using to collect your samples. If you are using one device you can only sample at a single frequency (the higher one you are interested in). You could sample both pressures at 500 Hz and decimate the unneeded exit samples.
Cameron T