Example Code

Synchronize DAQ and SCOPE Devices - Continuous

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Download All

Overview

When synchronizing SMC-based devices, T-Clk can be used. However in situations where you need to synchronize an SMC device with a non-SMC device, T-Clk will not work. In this example, I will describe the steps to synchronize a Multifunction DAQ device with an NI-SCOPE device. This can either be done in a continuous acquisition setting or a retriggerable acquisition setting. This is the continuous example

Description

If you are familiar with the examples that ship with the NI-SCOPE driver, you may notice that this looks similar to the "Fetch Forever" example. This is to get the continuous functionality out of our Scope device. The main components needed for continuous acquisition are a Software Reference Trigger and the "Fetch Relative To" niScope Property that we set to Read Pointer.

On the DAQ side, we use a basic continuous acquisition setup. The DAQ will act as the "Master" for this example which supplies the trigger to the Scope device.

For the synchronization, we need two main components.

1. Share a reference clock between the devices

2. Share a start trigger between the devices

In the Scope task, we use the niScope Configure Clock VI to instruct the Scope to use the PXI backplane clock. We also use the niScope Property "Start Trigger Source" to configure the Acquisition Arm Start Trigger. Lastly, the Scope task is started first to make sure we don't miss the trigger from the DAQ task.

In the DAQ task, we use the DAQmx Timing property "RefClk.Src" and "RefClk.Rate" to instruct the DAQ card to use the PXI backplane clock as well. Depending on the chassis, there may be two backplane clock options. Depending on your DAQ device and your chassis you may need to change the reference clock that is used. In either case, if there are two options, both backplane clocks are PLL'd, meaning that even if the devices use different backplane clocks, the acquisitions will still be phase coherent.

Requirements

Software

  • LabVIEW 2010 or compatible
  • NI-SCOPE 3.7 or compatible
  • DAQmx 9.1.5 or compatible

Hardware

  • SMC Digitizer
  • Most DAQ devices

Steps to Implement or Execute Code

  1. Open the DAQ_SCOPE_Sync_Continuous.vi attached below.
  2. Change the Resource Name and DAQmx Channel controls on the front panel to your Scope and DAQ devices respectively.
  3. Make sure that the DAQ and Scope sampling rate are the same.
  4. Edit the External Trig Source, Reference Clock Source, and Start Trig Output Terminal controls on the front panel to be appropriate for your device.
  5. On the block diagram, enable the subdiagram if you'd like to use an external trigger for the DAQ task.

Additional Information or References


BlockDiagram.PNG

**This document has been updated to meet the current required format for the NI Code Exchange.**


Robert B
RF Product Support Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
lovewhowho
Member
Member
on

very useful~~

两鬓斑白都可认得你
Y.Kwon
Active Participant
Active Participant
on

Thank you!

This code was used to synchronize PXI-4462 and PXI-5922 using PXI_CLK10.

FYI, I was able to show the data after replacing the graph indicator.

Contributors