The Current Time is Incorrect on My LabVIEW Real-Time Controller

Updated Jan 5, 2018

Reported In

Software

  • LabVIEW Real-Time Module

Operating System

  • NI Linux Real-Time
  • PharLap
  • VxWorks

Issue Details

Why are the time and date incorrect on my Real-Time Controller and how can I fix this?

Solution

Your time and date could be incorrect if you have not yet set the correct time zone for your controller.You can change the time zone your controller is set to by following the instructions in KnowledgeBase 61AD77P7: How to Set the Time Zone of a Real-Time Controller

If you have configured the correct time zone, the time your application displays may be offset from what you expect if your host computer is set to a different time zone than your real-time controller, depending on the method you are using to display the time after setting it. 

If you are using Get Date/Time in Seconds from the Timing palette, you are likely using a Time Stamp indicator to display the time on the front panel as it is the default data type of the function. 
This can cause the time of the Real-Time controller to be displayed in the time zone of your host computer rather than its own time zone. Because the front panels of all real-time applications reside on the host computer, a Time Stamp indicator will reference the time zone of the computer LabVIEW is running on, rather than that of the Real-Time Target. The Time Stamp will then automatically convert the date and time so the user can view the time in their own time zone. 

One way to avoid an unintentional time zone conversion is by using the Get Date/Time String VI, instead of Get Date/Time in Seconds VI, to obtain the current time on the controller. 
You could also convert the timestamp data type by using the Seconds to Date/Time VI. All of these functions can be found by navigating to Functions Palette»Programming»Timing. 

Additional Information

LabVIEW determines the host computer's time and date configuration at launch. You will need to restart LabVIEW for any change to the host computer's time zone to take effect. 

WAS THIS ARTICLE HELPFUL?

Not Helpful