Overview
This example demonstrates how to synchronize a S Series card to a X Series card and acquire a finite amount of data using an internal clock and a analog reference trigger in .NET C#.
Description
In this example, the S Series device has been made the master and the X Series device has been made the slave. The reason for this is that the S Series synchronization has the least flexibility compared to the X Series that has PLL circuitry as well as access to the master timebase where the S Series only allows access to the master timebase for Analog circuit. Along with this, the X Series card has a faster timebase so it is easier to export the low frequency timebase from the S Series device to the X Series device.
Steps to Implement Code
- Select the physical channels corresponding to where your signal is input on the DAQ device. Master is the S Series and Slave is the X Series
- Enter the minimum and maximum voltage values. Note: For better accuracy, try to match the input range to the expected voltage level of the measured signal
- Select the number of samples per channel to acquire
- Set the rate in Hz for the internal clock. Note: The rate should be at least twice as fast as the maximum frequency component of the signal being acquired
- Set the Analog Reference level as well as the polarity of the reference edges. Additionally, set the number of pre-trigger samples to be acquired
Code Execution Steps
- Create a new task for Master and Slave Task
- Initialize Master and Slave Local Variables
- Create the Master and Slave Channel
- Configure Master Slave and Master Timing Specs
- Configure Analog Reference Trigger
- Verify the Master and Slave Task (This verifies that the DAQmx task has been configured correctly.)
- Get Master Device name in order to export the trigger through backplane
- Set the Master Timebase of the X Series device to the Sample Clock Timebase on the S Series device
- Configure a start trigger on Slave task to start when the reference trigger on the Master occurs
- Verify that the Synchronization steps above
- Prepare Data for the table and wait for the trigger
- Read data from the channels and display the data
Requirements
Software
Visual Studio for development
.NET framework
NI DAQmx driver
Note: Can run executable without Visual Studio (exe is in Synchronize X-S_Series\CS\obj\Debug folder)
Hardware
PCI S Series card with analog trigger line (NI-611x or NI-6120)
PCIe X Series card
Shared trigger line (RTSI cable)
Additional Images