LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the same sample rate from 2 different acquisition devices?

I've seen many articles and videos on this and I've drastically improved some things. But I keep running into new problems and this one is stumping me. 

 

First - my colleague has a code that has been working for the instrumentation that we originally had. It was already code spaghetti.

 

I had the task of adding accelerometer data. When I did, I had to change how the DAQ.mx were set up because it kept throwing errors. For right or wrong, I added a Sample Clock and the error is gone. 

 

When I did that - the sampling rate for items this DAQ are now WAAAAAY faster than those coming from the other acquisition unit

I've attached 3 files, the VI, some example data, and a screenshot from the original data.

Just from the screenshot, you can see the Temperature and Accelerometer recorded about 15x more data points. 

 

Those 2 signals are coming from acDAQ and the others from the USB-6009. 

- I have 2 modules in the cDAQ - one is a max of 51.2 kHz and the other 100 kHz. 

- I also know the USB can only collect at 48 kHz. 

 

The first thing I did, was update the DAQ.mx setup he had and it helped a little. I've attached 3 similar files. Now I'm reading temp and acceleration about 50% faster. 

 

1.how do I speed up the data coming from the USB-6009. 

2. I need the time stamp for every data point - ideally. It's okay if the channels that read slower have blanks at these times because... 

3. One of the channels from one of the modules on the cDAQ will need to run as fast as physically possible to collect the data I need. How do I speed that sensor up? 

 

Please help! School us! 

0 Kudos
Message 1 of 6
(1,179 Views)

Missing attachment.

 

You need a common trigger that will tie the starting point of all the three modules and rely on hardware timing to estimate the timestamp of every sample from thereon.

 

Please list the DAQ modules you wish to synchronize.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(1,175 Views)

Hi This!,

 


@EngineerThis! wrote:

1.how do I speed up the data coming from the USB-6009. 

2. I need the time stamp for every data point - ideally. It's okay if the channels that read slower have blanks at these times because... 

3. One of the channels from one of the modules on the cDAQ will need to run as fast as physically possible to collect the data I need. How do I speed that sensor up? 


  1. The USB6009 is limited to 48kS/s for all AI channels (MUX!). The more AI channels you use the slower the samplerate of each channel: no way around this limitation…
  2. Read waveforms from DAQmxRead to get a timestamp for each sample…
  3. Use the max samplerate of the cDAQ module to "run as fast as possible"…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(1,113 Views)

You have 3 devices to collect data. (at different sample rates, or you are lucky to find a common samplerate, so digg in the manuals/specs since the SR is usually not arbitary)

If you want to syncronise the data streams, you can

 

Best: use one common clock to derive all sample clocks and use one common start trigger.

(Seems possible with cDAQ in one chassis (Never used it) , the 6009 is out here , usually PXI(e) is the way to go)

 

Use absolute (or relative with common strat trigger) timestamping. Just keep in mind that without a common (locked) clock all internal timebases are different (or should I say unknown within some PPM, Woun't hurt for some seconds but ...)

 

Or share one channel at each device with a common signal. (sine, pulse , sweep... ) and do some resampling and alining later.

 

Oh, and for multiplexed DAQs remember that they are sampled in sequence...

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 6
(1,067 Views)

I swear I submitted the attachments. I'll go back and see if I can edit it. 

 

Nonetheless, I am trying to sync the NI-9234, NI-9219, and USB-6009. 

 

I was having trouble with some analog inputs into the NI-9219, so all but 1 are feeding into the USB-6009. I also need the USB-6009 for an analog output, which I will be replacing with an NI-9263 (hopefully today). At that time, I will try my luck bring the analog inputs back to the NI-9219 and replace the counter with an analog speed sensor so I can eliminate the USB-6009 altogether. I hope this will eliminate some of my woes. 

 

If it's helpful, here are more details

NI-9219 - thermocouple

NI-9234 - accelerometer

USB-6009 - Valve position command output (0-5V), Valve position, air temperature, air speed, counter (for tachometer), and bearing load.

0 Kudos
Message 5 of 6
(991 Views)

@Henrik_Volkers wrote:

 

Best: use one common clock to derive all sample clocks and use one common start trigger.

(Seems possible with cDAQ in one chassis (Never used it) , the 6009 is out here , usually PXI(e) is the way to go)

 


USB multifunction DAQ's support this as well, you just have to connect a couple PFI lines with an external wire. Export your clock out of one device and tell the other device to use whichever PFI as its input clock source.

Message 6 of 6
(979 Views)