How to Set the Time Zone of a Real-Time Controller

Updated Aug 9, 2018

Reported In

Software

  • LabVIEW Real-Time Module

Issue Details

I would like to configure my Real-Time controller's time zone.  How can I accomplish this?

Solution

By default, the real-time controller is set to Coordinated Universal Time (UTC). You can configure the time zone using one of the following methods. 

Measurement & Automation Explorer:
Select the desired time zone in Measurement & Automation Explorer (MAX) on the Time Settings tab of the Real-Time target.
Modifying the INI File:
The time zone of a Real-Time controller can also be changed by modifying the RTTarget.TimeZone token in the ni-rt.ini. The token can be found in the [LVRT] section of the ni-rt.ini file. 
  1. Use WebDAV or FTP to copy the ni-rt.ini file from the Real-Time controller to the development computer.
  2. Open the ni-rt.ini file in a text editor (for example Notepad).
  3. At the top of the file there is a section named[LVRT]which is where the RTTarget.TimeZone token may be found, or added.
  4. To change the time zone either add, or modify the RTTarget.TimeZone token to the INI file. For example, use INI token RTTarget.TimeZone=CST6CDT to set the controller to the Central United States time zone. Available INI values are listed in the table below. 
   
INI Value    Time Zone    UTC Offset
CUT0GDTCoordinated Universal TimeUTC
GMT0BSTUnited KingdomUTC
AZOREST1AZOREDTAzores, Cape Verde    UTC-1
FALKST2FALKDTFalkland Islands    UTC-2
GRNLNDST3GRNLNDDTGreenland, East Brazil    UTC-3
AST4ADTCentral Brazil    UTC-4
EST5EDTEastern United States, Colombia    UTC-5
CST6CDTCentral United States, Honduras    UTC-6
MST7MDTMountain United States    UTC-7
PST8PDTPacific United States, Yukon    UTC-8
AST9ADTAlaskaUTC-9
HST10HDTHawaii, Aleutian Islands    UTC-10
BST11BDTBering Strait    UTC-11
NZST-12NZDT    New Zealand    UTC+12
MET-11METDT    Solomon Islands    UTC+11
EET-10EETDT    Eastern Australia    UTC+10
JST-9JSTDT    Japan    UTC+9
KORST-9KORDT    Korea    UTC+9
WAUST-8WAUDT    Western Australia    UTC+8
TAIST-8TAIDT    TaiwanUTC+8
THAIST-7THAIDT    ThailandUTC+7
TASHST-6TASHDT    Central Asia    UTC+6
PAKST-5PAKDT    PakistanUTC+5
WST-4WDT    Gorki, Central Asia, Oman    UTC+4
MEST-3MEDT    Turkey    UTC+3
SAUST-3SAUDT    Saudi Arabia    UTC+3
WET-2WET    FinlandUTC+2
USAST-2USADT    South Africa    UTC+2
NFT-1DFT    NorwayUTC+1

       5. Save the file as ni-rt.ini locally (such as the desktop). Be sure the file is named ni-rt.ini.
       6. Use WebDAV or FTP to transfer the file back to the Real-Time controller.
       7. Reboot the Real-Time controller.

Note: Linux Real-Time targets support the tz (or Olson) database. The database contains all needed information about DST settings for specific time zones. The RTTarget.DSTRule INI token cannot be changed to alter DST rules on Linux RT targets.


LabVIEW 2012 Real-Time Module and later:
The LabVIEW 2012 Real-Time Module introduced the NI System Configuration API which can be used to programmatically set the time zone of a Real-Time Controller using the Set Time VI. The input timezone string for the Set Time VI needs to be of the form Etc/GMT-X where positive values for X represent hours west of the GMT. For example Etc\GMT+6 is the equivalent to Central Standard Time in the US. Valid values range from 12 to -13 centered around GMT.
For more information on how to set timezones see the Set Time (VI) help
 
Note: VxWorks and Pharlap targets must be restarted for the time zone settings to apply. NI Linux Real-Time targets do not require a restart. Configuring the time zone also activates the daylight saving feature of the controller.

LabVIEW 2011 Real-Time Module and Previous:
The LabVIEW 2011 Real-Time Module and previous Real-Time Modules do not include support for setting a specific time zone. Instead, it is recommended to set time programmatically using the RT Set Date and Time VI.

WAS THIS ARTICLE HELPFUL?

Not Helpful