Synchronizing Multiple Tasks With DAQmx API in CompactRIO

Updated Jun 1, 2023

Reported In

Hardware

  • cRIO-9040
  • cRIO-9053
  • cRIO-9049
  • cRIO-9047
  • cRIO-9045
  • cRIO-9042
  • cRIO-9055
  • cRIO-9054
  • cRIO-9058
  • cRIO-9056

Driver

  • NI-DAQmx

Issue Details

I have cRIO chassis which is DAQmx compatible. I want to create analog input task and digital input task and make these two tasks synchronized together.
I want to share sampling clock of analog input task but I cannot find ai/SampleClock from DAQmx timing resource list. How can I use ai sampling clock in order to share this with other modules for synchronization ?

Solution

In cRIO DAQmx program, you should select it<n> for clock sharing instead of ai/SampleClock.
In cRIO 904X or 905X, each slot has different timing engine. For example if you are using cRIO9049, you can use 8 different timing engines thus you can create 8 different tasks which have individual timing source. See the following table for each timing engine name.

Samp TimingEngine ValueAnalog Input, Digital Input, and NI 9361 Timing Engine UsedAnalog Output and Digital Output Timing Engine Used
0it0ot0
1it1ot1
2it2ot2
3it3ot3
4it4ot4
5it5ot5
6it6ot6
7it7ot7

For example. if you have analog input module in slot0 of cRIO1 and want to share this sampling clock with the other tasks, you should select /cRIO1/it0/SampleClock for source of DAQmx Timing.vi in the other tasks.
Please refer to the DAQmx help CompactRIO Timing Engines  topic for more information.