Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How Can I Plot My X-Axis in Units of Seconds Starting at Zero?

Primary Software: LabVIEW Development Systems>>Base Package
Primary Software Version: 8.5
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:

I am using a waveform chart or graph, and I want to plot my x-axis in units of seconds starting at zero, not with a time stamp.



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 your graph and select Create  Property Node » X Scale » Offset and Multiplier » Multiplier.



2.  Right-click your newly created property node and select Change to Write.


3.  Use the inverse of the Rate input on your DAQmx Timing VI to set this property.




4.  The last step is to make sure you are sending an array, not a waveform to your chart.  There are two options for this. 

  • Option 1:  Use a DAQmx Read Waveform VI and then use a Get Waveform Components VI to plot only the y values.

Option 1:  Use a DAQmx Read Waveform VI

  • Option 2:  Use a DAQmx Read 1D or 2D array and plot this.

Option 2:  Use a DAQmx Read Array VI

On a related note, if you're using a waveform graph this will continually update the graph between 0 seconds and one chunk of data.  If you read N samples at a rate of X then it will plot from 0 to N * X seconds.  A waveform chart will retain a history of the data you graph and once this history length is full the display will begin scrolling to larger values.  By default this history length is 1024 samples, but you can increase this to up to 10000000 by right clicking on the graph and going to left clicking on Chart History Length.  The attached VI shows an example of how to do this for a simple continuous analog input.



Related Links:
KnowledgeBase 3LOG5KHD: How Do I Configure the X-Axis to Display the Output of the Spectral Measurements Express VI in Hertz?
KnowledgeBase 1W3F9QHE: How Do I Set the Time and Date on the X-axis of a Graph in LabVIEW?
KnowledgeBase 3E6I65K7: Displaying Current Time on a LabVIEW Chart
KnowledgeBase 48AB3HCY:  How to Learn LabVIEW
LabVIEW Help: Configuring the X- and Y-Axes on a Graph or Chart

Attachments:
Plot Starting at Zero Seconds.VIPlot Starting at Zero Seconds.vi




Report Date: 04/30/2008
Last Updated: 05/02/2008
Document ID: 4KTFBLE9

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit