Example Code

PXI Timing - Adding Timestamps to Data 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.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI shows how to configure your Timing and Sync boards to time stamp multiple events.

 
Description

This VI will add a GPS, IEEE 1588, or IRIG-B timestamp to data using a PXI timing card such as the 6682 and a PXI data acquisition card.  It will create a tab-delimited text wile with 2 columns, the first of which has the timestamp and the second of which has the data.  Currently this VI will only work with a single channel of data, but can be modified to use more.

This VI works by exporting the DAQ sample clock through the PXI trig lines.  To use, set the backplane terminal, the data acquisition channel, and the file path for your data.  This code was created using the Time Stamp Clock-Count and Voltage-Continuous Input VIs in LabVIEW 2012.

Wire the modules as according to the modules.  No external wiring is required between the timing and DAQ card.


Requirements

  • LabVIEW 2012 (or compatible), niSync 3.4.0 (or compatible).


Steps to Implement or Execute Code

  1. Specify the same trigger for Data Acquisition and Time Stamping.
  2. Specify the Time Stamp Buffer Size for Time Stamping; specify the Physical Channel, Max/Min Voltage, Terminal Configuration, Sample Clock Source, Sample Rate, Sample per Loop for Data Acquisition; specify the Data File Path for Logging.
  3. Run the Vi, events will be captured and displayed after the niSync Enable Time Stamp Trigger.vi has executed. Events will continue to be captured and displayed until a timeout occurs or the stop button is clicked.

 

Additional Information or References
VI Snippet

002.png 

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

Patrick W.
Applications Engineer
National Instruments

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