LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronization Issue - Ni cDAQ-9188

Hello,

 

I have what I consider to be a very strange Labview synchronization problem.

 

I'm using a cDAQ-9188 with (3) 9222 modules, (1) 9402 module, and (1) 9221 module. It also has 2 9481 relays in case that's pertinent.

 

The 9222 modules record at 100 kHz and the 9221 records at 1000 Hz (typically).

 

The 9402 is generating a pulse train on one channel to act as a triggering signal to synchronize the 9222 and the 9221 modules. All the data streams to a TDMS file for later processing.

 

I thought I had this all figured out, things seemed to be synchronized well. Started fiddling with synchronizing a high speed camera and I noticed that my signals weren't synchronized. Went back to the original file to check and sure enough I don't get a consistent synchronization between the modules.

 

I test the synchronization with a TTL pulse from the 9402 when I click the "record" button. I split the signal and run it to a single channel on the 9222 and the 9221 for visualization/recording. The 9222 typically picks up the signal at 25000 - 26000 counts which means the 9221 should pick it up arount 250 - 260 counts. It does the first 1 - 2 runs on a fresh restart perfectly synchronized. Sometimes on run 2 and almost always on run 3 the 9221 seems to lose synchronization, it picks it up the TTL pulse at just over 2x the expected value (never exactly double). Example: 9222 gets it at 25987 and the 9221 gets it at 547 instead of the expected 260 (rounding).

 

If I restart the computer completely I will be perfectly synchronized for 1 or 2 runs. By the third run the 9221 is lagging the 9222 and the problem only fixes itself it I restart the entire machine.

 

Again, I've gone back to what I thought was the original file that I thought worked. I showed it to a coworker about a half-dozen times and he clearly remembers it working as well. 

 

I just can't find the mistake, I need a second pair of eyes to look at it. Did I miss something obvious?

 

Download All
0 Kudos
Message 1 of 3
(2,247 Views)

Hi skinnert,

 

In order to synchronize your DAQmx tasks, make sure that your tasks share a master timebase (reference clock), a sample clock, and a start trigger. There are a couple examples of this in the NI Example Finder under Hardware Input and Output » DAQmx » Synchronization. You should determine which task is your master task and have all others be slaves to that task. Here is a community example you might find helpful:

 

https://decibel.ni.com/content/docs/DOC-4797

Kelsey W.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(2,218 Views)

Thanks!

 

I'll check this out and report on my results.

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