04-30-2020 10:44 PM
Hello!
My Hardware:
cDAQ-9188 Ethernet Chassis
2 pcs NI 9234 DSA modules
I've some troubles with synchronizing these two dsa modulkes when running at different sample rates. I've done synchronization with DAQmx functions and followed the steps from http://www.ni.com/tutorial/53867/en/
Unfortunately, it's written for Labview, not for text based programming. It's not possible (up to now) to use the SyncPulse with it's SyncPulseResetDelay property. I'm able to read the SyncPulseResetTime's for the two tasks (one with high, one with lower sample rate) and I'm able to set the SyncPulseResetDelay, but when starting the tasks, there seems to be no SyncPulse at all. Maybe I miss a DAQmx function for Release of the Pulse...
Here is what happens in my code:
- set up the two tasks with different sample rates
- use same SampClkTimebaseSrc and SampClkTimebaseRate for both modules
- setting the DAQmxCfgSampClkTiming for Slave and Master
- then, read the SyncPulseResetTime from Slave and Master
- set the SyncPulseResetDelay of Slave and Master according to max(ResetTime's of all tasks) - SyncPulseResetTime of this task
- reserve master task (the one with slower sample rate) via DAQmxTaskControl(MasterTaskHandle,DAQmx_Val_Task_Reserve)
- read the SampClkTerm and SyncPulseTerm from reserved Master
- use SampClkTerm from Master to trigger the Slave with DAQmxCfgDigEdgeStartTrig(SlaveTaskHandle,...)
- use SyncPulseTerm from Master as SyncPulseSrc for the Slave
- DAQmxStartTask(SlaveTaskHandle) the Slave (waiting for trigger)
- DAQmxTaskControl(MasterTaskHandle,DAQmx_Val_Task_Commit) the Master
- as I understood, with setting state of the Master to "commit", the Master releases a SyncPulse at the SyncPulseTerm and thus, the Slave should get the SyncPulse, because the Slave's SyncPulseSrc is connected to the Master's SyncPulseTerm. But unfortunately, there seem to be some problem. Is it possible, that the SyncPulse isn't recognized by the Slave, because the Slave is waiting for trigger? If so, how is it done? How do I control the release of the SyncPulse to be sent when both tasks are running?
- starting the continuous acquisition with DAQmxStartTask(MasterTaskHandle).
The trigger for the slave works fine, but not the SyncPulse. The next interesting thing is, that (of course, without the SyncPulse functionality), I get time delay between the two tasks (triggered start) of exactly 0.3*Delta of SyncPulseResetTime. This is very strange, but if I do the Signal Sync for the delay in postprocessing (because SyncPulseResetDelay does not work properly), the delay between the two signals is 0.3*DeltaSyncPulseResetTime.
I added two figures. One is the synced measurement data, when I subtract 0.3 times Delta in postprocessing. The other one is the corresponding Labview VI for this type of Sync. I marked a connection that could be some kind of SyncPulseLine I forgot in my code, so what is it? What's the corresponding DAQmx function for that Symbol?
Hope, you can help me,
Kind regards, BertramD