03-24-2023 10:14 AM
Hi,
I have been using the Python nidaqmax package to simultaneously acquire analog inputs from two NI9239 (BNC) plugged into a cDAQ9185.
My issue is that I am not managing to use the same clock for all the channels to synchronize my measurements.
The code worked fine when using the internal clock of each of the NI9239 respectively ( i.e in the code replacing the underlined lines with source = "/cDAQ9185-213AB07Mod1/ai/SampleClock" in task A, and source = "/cDAQ9185-213AB07Mod2/ai/SampleClock" in task B).
However, when using one of the cDAQ9185 clock as a common clock (as in the code below), the code returned errors. The different sources can be seen in the attached screenshot of the NIMAX software. I have also tried using "/cDAQ9185-213AB07/80MHzTimebase" without success.
Another attempt consisted in using the internal clock of one of the module as the common clock as it seems to be the case in: Résolu : Python multi-tasking using cfg_samp_clk_timing question - NI Community ( i.e in the code replacing the underlined lines with source = "/cDAQ9185-213AB07Mod1/ai/SampleClock" in task A, and source = "/cDAQ9185-213AB07Mod1/ai/SampleClock" in task B). But this also returned errors.
Any help to achieve this synchronisation would be much appreciated.
Here is my code below:
-----------------------------------------------------------------------------------------------------------------------------------------------------
Solved! Go to Solution.
03-24-2023 12:53 PM
You can use channel expansion and add multiple channels into a single task. DAQmx driver will handle the timing routing for you.
03-27-2023 04:17 AM
Thank you for your prompt reply. This worked perfectly, thank you !!