Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

Display Current Time on a LabVIEW Chart with Absolute Time Setting


This document demonstrates how to add timing information so a chart displays the correct time.


As discussed in KnowledgeBase 326F9HIP: Displaying the Current Time in a Graph/Chart, displaying Absolute Time on a Chart with no timing information displays the starting time and date as 6:00pm 12/31/1903.  The purpose of this example is to illustrate a few methods for displaying the correct timing information on a LabVIEW chart.

Method 1 involves setting the correct timing information in a chart's property node so that the x axis scales properly.  The multiplier will be set to the time between samples and the offset will be set to the time of the initial sample, as seen below.

Absolute Time Chart-BD.png

Method 2 involves setting this timing data into a waveform data type, which will scale the chart automatically when it is set as an input.  The actual values being set are similar, but they are packaged into the properties of the waveform itself rather than the chart, as seen below.

Absolute Time Chart-BD 2.png


LabVIEW 8.0 (or compatible)

Steps to Implement or Execute Code

Method 1

  1. Download Absolute Time Chart-8.0.vi
  2. Run the code.  To see different Samples per Second reflected in the waveform, stop the VI and restart it.

Method 2

  1. Download Absolute Time Chart 2-8.0.vi
  2. Run the code.  To see different Samples per Second reflected in the waveform, stop the VI and restart it.

Additional Information or References

Absolute Time Chart-FP.png

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

Alex Person
NI-RIO Product Support Engineer
National Instruments
Member heel

I tried this in LV2012. The second program model using waveforms works nicely, however the first using manipulation of the offset of the x-axis does not work if the chart already contains data from a previous run.

And after a few thoughts - it can never work without filling in the missing time laps. So to make sense, the chart should be cleared upon start. Then it works.

Member abh

I want to get the correct time in my chart but unable to do so as i am applying the second method illustrated above. please help i am working with analog I/O 's of NI WSN Devices.

Member kaywr

I need to fill in the X-axis with 7 "major tick marks", including time and date, to display a 7-day temperature trend chart.  I was able to do so using Labview 6.1 but not with 2009.  Please help