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:
- Using Measurement & Automation Explorer (MAX).
- Modifying the INI file.
- Using NI System Configuration APIs.
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 (for VxWorks or Phar Lap ETS Real-Time Targets only):
The following method is limited to Phar Lab & VxWorks based targets. If your device is running NI Linux RT, please follow the steps listed in
this article, if not please continue.
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.
- Use WebDAV or FTP to copy the ni-rt.ini file from the Real-Time controller to the development computer.
- Open the ni-rt.ini file in a text editor (for example Notepad).
- At the top of the file, there is a section named [LVRT] which is where the RTTarget.TimeZone token may be found or added.
- 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 |
---|
CUT0GDT | Coordinated Universal Time | UTC |
GMT0BST | United Kingdom | UTC |
AZOREST1AZOREDT | Azores, Cape Verde | UTC-1 |
FALKST2FALKDT | Falkland Islands | UTC-2 |
GRNLNDST3GRNLNDDT | Greenland, East Brazil | UTC-3 |
AST4ADT | Central Brazil | UTC-4 |
EST5EDT | Eastern United States, Colombia | UTC-5 |
CST6CDT | Central United States, Honduras | UTC-6 |
MST7MDT | Mountain United States | UTC-7 |
PST8PDT | Pacific United States, Yukon | UTC-8 |
AST9ADT | Alaska | UTC-9 |
HST10HDT | Hawaii, Aleutian Islands | UTC-10 |
BST11BDT | Bering 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 | Taiwan | UTC+8 |
THAIST-7THAIDT | Thailand | UTC+7 |
TASHST-6TASHDT | Central Asia | UTC+6 |
PAKST-5PAKDT | Pakistan | UTC+5 |
WST-4WDT | Gorki, Central Asia, Oman | UTC+4 |
MEST-3MEDT | Turkey | UTC+3 |
SAUST-3SAUDT | Saudi Arabia | UTC+3 |
WET-2WET | Finland | UTC+2 |
USAST-2USADT | South Africa | UTC+2 |
NFT-1DFT | Norway | UTC+1 |
- Save the file as ni-rt.ini locally (such as the desktop). Be sure the file is named ni-rt.ini.
- Use WebDAV or FTP to transfer the file back to the Real-Time controller.
- Reboot the Real-Time controller.
Note: Linux Real-Time targets support the tz (or Olson) database. The database contains all the 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.
NI System Configuration APIs:
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 time zones see the
Set Time (VI) help.
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
If the above code snippet is executed on the Real-Time target, the Target parameter must have a value of localhost. Otherwise, error -2147467263 will be thrown (NI System Configuration: This operation is not implemented for this target or resource).
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.
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.