11-10-2017 11:36 AM
Hi
i have a single task that uses 2 X-series cards PCIe 6363 with a RTSI cable connected.
i made exported signals to start triggers to connect and run both cards. i looked in the examples for multi device synchronization and it lists other devices e,m,,s series but nothing is listed for x series.
when i run the application it works with just the start trigger no errors, but i am curious that in the manual it says to take the master card and export the source clock and route it to the slave card and back to the source clk. if there is any documentation or specific example in CVI that references this please attach
11-13-2017 10:43 AM
Hi Iriddick,
The "ContinuousAI.prj" example that I think you stumbled upon should work for X Series, even though it isn't explicitly mentioned.
Looking at the X Series User Manual, under the 'Synchronizing Multiple Devices' section for PCIe devices, it only mentions that you need one device as your timebase which you can route via RTSI to another device. Would you mind sharing where in the manual it says to route to the slave card and back to the source clock?
BrandonN
Applications Engineer
National Instruments
11-20-2017 06:17 AM
In the example
* Steps:
* 1. Create a task.
* 2. Create an analog input voltage channel for both the Master
* and Slave devices.
* 3. Set timing parameters. Note that sample mode is set to
* Continuous Samples. In this example, the Rate and the Samples
* per Channel is set the same for both devices, you can however
* use different values for each device.
* 4. The synchronization method chosen depends on what type of
* device you are using.
* 5. Call the Get Terminal Name with Device Prefix utility
* function. This will take a Task and a terminal and create a
* properly formatted device + terminal name to use as the
* source of the Slaves Trigger. For the Slave, set the Source
* for the trigger to the ai/StartTrigger of the Master Device.
* This will ensure both devices start sampling at the same
* time. (Note: The trigger is automatically routed through the
* RTSI cable.)
* 6. Call the Start function to start the acquisition.
* 7. Read all of the data continuously. The 'Samples per Channel'
* control will specify how many samples per channel are read
* each time. If either device reports an error or the user
* presses the 'Stop' button, the acquisition will stop.
* 8. Call the Clear Task function to clear the task.
* 9. Display an error if any.
*
DAQmxErrChk (DAQmxCreateTask("",&gMasterTaskHandle)); (DAQmxCreateAIVoltageChan(gMasterTaskHandle,masterChan,"",DAQmx_Val_Cfg_Default,masterMin,masterMax,DAQmx_Val_Volts,NULL));
(DAQmxCfgSampClkTiming(gMasterTaskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,gSampsPerChan));
(DAQmxCreateTask("",&gSlaveTaskHandle));
(DAQmxCreateAIVoltageChan(gSlaveTaskHandle,slaveChan,"",DAQmx_Val_Cfg_Default,slaveMin,slaveMax,DAQmx_Val_Volts,NULL));(DAQmxCfgSampClkTiming(gSlaveTaskHandle,"",rate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,gSampsPerChan));
In the manual
To synchronize multiple devices to a common timebase, choose one device—the initiator—to
generate the timebase. The initiator device routes its 10 MHz reference clock to one of the
RTSI <0..7> or PFI <0..15> signals.
All devices (including the initiator device) receive the 10 MHz reference clock from RTSI or
PFI. This signal becomes the external reference clock. A PLL on each device generates the
internal timebases synchronous to the external reference clock.
Once all of the devices are using or referencing a common timebase, you can synchronize
operations across them by sending a common start trigger out across the RTSI or PFI bus and
setting their sample clock rates to the same value.
In the example: this is referencing 2 or more separate tasks that are to be synced across two devices or more. Where you can access both devices since they have 2 different tasks.
I have one task across 2 devices and am unable to access the second device routing pins since the task is shared between 2 tasks.
What I did was
DAQmxErrChk ( DAQmxExportSignal(gDAQTaskHandleAI,DAQmx_Val_10MHzRefClock,"/Dev1/RTSI1"));
DAQmxErrChk ( DAQmxExportSignal(gDAQTaskHandleAI,DAQmx_Val_StartTrigger,"/Dev1/RTSI0"));
DAQmxErrChk ( DAQmxSetTimingAttribute (gDAQTaskHandleAI, DAQmx_RefClk_Src,"/Dev1/RTSI1"));
DAQmxErrChk ( DAQmxExportSignal(gDAQTaskHandleAI,DAQmx_Val_StartTrigger,"/Dev2/RTSI0"));
DAQmxErrChk ( DAQmxConnectTerms("/Dev2/RTSI0","/Dev1/RTSI0", DAQmx_Val_DoNotInvertPolarity)); (DAQmxCfgSampClkTiming(gDAQTaskHandleAI,"OnboardClock",g_AIrate,DAQmx_Val_Rising,DAQmx_Val_ContSamps,g_sampsPerChan));
If I add the following lines below I get an error when I ran it. but the code above ^^^^^^^ works I assume that is because the second card is referencing the task reference clock
// DAQmxErrChk (DAQmxExportSignal(gDAQTaskHandleAI,DAQmx_Val_SampleClock,"/Dev2/RTSI1"));
// DAQmxErrChk ( DAQmxConnectTerms("/Dev1/RTSI1","/Dev2/RTSI1",DAQmx_Val_DoNotInvertPolarity));