Change the X-Axis Units on a Waveform Graph or Chart to Seconds

Updated May 3, 2018

Reported In

Software

  • LabVIEW 2014 Full
  • LabVIEW 2014 Base
  • LabVIEW 2014 Professional

Driver

  • NI-DAQmx

Other

Windows 10

Issue Details

I'm plotting data on a waveform chart or graph, and the X-axis units are currently in the form of a timestamp. Instead, I'd like to see the units in seconds. 

Solution

The easiest way to do this is to plot an array of data, rather than a waveform, and then scale the X-axis by the inverse of your sample rate. 

1. In order to access this property, right-click on the graph and select Create Property Node » X-Scale » Offset and Multiplier » Multiplier.
  1. Right-click the newly created Property Node and select Change All to Write. 
  1. Use the inverse of the Sample Rate input from the DAQmx Timing VI to set this property.
  1. Ensure data is being passed to the waveform chart as an array instead of as a waveform. There are two options for this:
  • Option 1: Use the DAQmx Read Waveform VI combined with the Get Waveform Components VI to plot only the y values.
​​​​
  • Option 2: Use the DAQmx Read 1D or 2D array and plot the resulting array.
The graph or chart will now display data starting at 0 seconds. If N number of samples are read at a rate of X then the graph or chart will display data between 0 and N*X seconds. See the attached VI to see an example of how to implement these changes.

WAS THIS ARTICLE HELPFUL?

Not Helpful