From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

PXI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to synchronize AI, Ao and DIO in rt

Hi, In my application i want to acquire all Analog Input and Output and DIO simultaneously. Iam running this application in RT module so please can any one give the right way to code to synchronize these three channels.
0 Kudos
Message 1 of 2
(3,120 Views)
Hi Suri,
 
There are several examples to synchronize different tasks (AI, AO, DIO).  Synchronization of the Digital lines in the following method requires that you have correlated (hardware-timed) digital IO.  Synchronization can be achieved either by triggering or sharing a sample clock.  The following steps are generally followed:
 
1) One task is selected to trigger the other tasks (i.e the analog input sample clock can be used to clock or trigger the other tasks (AO, DIO)). 
 
2)This task is configured first and the sample clock is provided to the other tasks. 
 
3)A DAQmx Start Task is called for the other tasks before calling the DAQmx Start Task for the selected triggering task. 
 
If you are working with LabVIEW, search the Example Finder (Help>>Find Examples) for "Function Synchronization" to bring up the DAQmx synchronization examples. The examples generally synchronize 2 tasks, however the theory could be expanded to 3.
 
Regards,
 
Jennifer O.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,108 Views)