Example Code

Create Visual Markers On a Chart at Runtime

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

This example allows the user to create markers in the data using a keypress event.

 

Description

The VI is adapted from the "Cont Acq&Graph Voltage-int clk.vi" DAQmx example.A zero value "marker" waveform is generated and inserted into the DAQmx waveform array. The marker waveform inherits its properties from the waveforms generated by the DAQmx read function, and its chunk size is determined by the "Samples to Read" control, ensuring that it will fit seamlessly alongside the measured data.When the user presses the "Enter" key on the numeric keypad, a "spike" of user-specified magnitude is inserted into the marker waveform, creating a visual marker in the graph. If the data is written to a file, this marker data can be used as a reference in the file, too.

 

 

Requirements

Software

  • LabVIEW 2012 or compatible
  • NI-DAQmx 9.5.5 or compatible

Hardware

  • NI Multifunction DAQ Device

 

Steps to Implement or Execute Code

  1. Download and open the VI

  2. Set the acquisition parameters.

  3. Set the reference marker parameters.

  4. Run the VI.

  5. Press "Enter" (on the numeric keypad) to insert a spike in the marker waveform.

 

Additional Information or References

 

 

insert_data_markers.png

marger_chart.png

 

 

Additional Notes

 

The DAQmx Read VI must be set to "N Chan N Samp" with a waveform output type. The marker waveform is inserted into the DAQmx waveform array using the "Insert Into Array" function, and assumes that the DAQmx Read is passing a 1D array of waveform. If a single waveform is passed by DAQmx, "Insert Into Array" must be replaced by "Build Waveform."

 

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

 

Caleb Harris

National Instruments | Mechanical Engineer | http://www.ni.com/support

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

Comments
Vladiator
Member
Member
on

It would be nice to create examples without DAQ drivers - just use simulation for a signal. I can't use is since it gives me device errors.