Sunteți pe pagina 1din 2

How Do I Display Current Time on a LabVIEW Chart?

Primary Software:
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A
Problem:
I have noticed that setting the time as Absolute Time on a Waveform Chart will cause the time display to start
at 6:00 PM, 12/31/1903. How do I display the Absolute Current Time?
Solution:
Without any timing information in your data, a LabVIEW chart will use these default values. To display the time
as both absolute and current, use the following property nodes:

1.

o
o
o
o
2.

o
o
o
o

Offset and Multiplier:Multiplier Property. This property node will serve as the delta-T, or time between
samples displayed on your waveform chart.
Right-click your chart on the Block Diagram.
Select CreateProperty NodeX ScaleOffset and MultiplierMultiplier.
Right-click the new property and select Change All To Write.
Wire in the numeric value 1/x, where x is the number of samples displayed per second.
Offset and Multiplier:Offset Property. This property node will set the starting time for your chart to the
current time and date.
Drag down the previous property node to create another entry.
If the property node does not say XScale.Offset, left-click the new property entry and navigate to X
ScaleOffset and MultiplierOffset.
Place a Get Date/Time In Seconds on the block diagram.
Place a To Double Precision Float function on the block diagram and wire it to the property node as
shown below.

If you have not already set the time Display Format to Absolute, do so by either:

1.

o
o
o
o
o

Changing the formatting settings in LabVIEW.


Right-click the chart on the front panel and select Properties.
Click the Display Format tab.
Select Absolute Time as the Type.
Select System time format from the two drop down boxes on the right.
Click the OK button.

2.
3.

o
o
o

Using the Display Format:Format Property.


Place a property node on the block diagram.
Select X ScaleDisplay FormatFormat.
Wire in the numeric value 7 to select Date and Time.

You can view an example demonstrating the use of these property nodes at NI Community: Display Current
Time on a LabVIEW Chart with Absolute Time Setting. Note the wait function inside of the while loop. It is
required for setting the rate of the loop to generate the correct number of samples per second.
Related Links:
NI Community: Display Current Time on a LabVIEW Chart with Absolute Time Setting
LabVIEW 8.5 Help: Offset and Multiplier:Multiplier Property
LabVIEW 8.5 Help: Offset and Multiplier:Offset Property
LabVIEW 8.5 Help: Display Format:Format Property
KnowledgeBase 2WOE97DS: 'Seconds To Date/Time' Function in LabVIEW Does Not Return 12:00 a.m., Jan
01, 1904 When I Input Zero Seconds
KnowledgeBase 2V4FANW0: Wrong Timestamp Listed in Waveform Data Type
KnowledgeBase 2HDCFJV5: Universal Time and LabVIEW

S-ar putea să vă placă și