From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Example for Synchronizing two DAQ devices Using LabVIEW with DAQmx

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

Overview

Demonstrate the synchronizing two USB DAQ devices so that they were sampling on the same time scale.


Description
I recently needed to synchronize two USB DAQ devices so that they were sampling on the same time scale.  Although NI has several great resources and examples for synchronizing PCI and PXI devices, for which the clock and trigger signals can be shared via internal signal routing, I could not find any specific examples showing how to synchronize two external DAQ devices.  Building off the NI examples, I could create a program that routed the clock and trigger lines from one USB device out some PFI pins an into PFI pins on the second device.  With the proper configuration calls, connection of several wires from one device to the other, and some juggling of time stamps, I could acquire data from both devices that is synchronized in hardware.

 
Requirements

  • LabVIEW 2012 (or compatible)
  • NI-DAQ 12.0 (or compatible)


Steps to Implement or Execute Code

  • Select the device or physical Channels you pick.
  • Enter the sample parameters such as minimum and maximum value and sample rate.
  • Select the waveforms to display.
  • Run the program

 

Additional Information or References
VI Snippet

3-220.png

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

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.

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