Topic: DMD0039

NETTIME - SNTP Client


The SNTP Client (NETTIME) instruction is used to retrieve clock and calendar information from a Time Server using the Simple Network Time Protocol (SNTP). The time value retrieved from a server will be in UTC coordinates. The current time ($Now) is then calculated by applying a local Time Zone offset value ($TimeZone, DST384), and optionally adjusting for Daylight Savings time ($SummerTime, ST768).

 

This instruction can be used in conjunction with TimeSync to synchronize the real-time clocks in multiple Do-more controllers with the time on an SNTP server.

 

Parameters:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Device - designates which of the Ethernet Devices to use. For more information on configuring devices go to the Device Configuration Section under System Configuration.
 

  • @IntEthernet - selects the onboard Ethernet port on the Do-more controller.
     

  • no devices available - indicates that there are no Devices that can execute this instruction, that is, the CPU does not have an onboard Ethernet port.

 

SNTP Server IP Address - the TCP/IP Address of the SNTP server to contact for the clock and calendar information. The default SNTP Server IP Address of 12.69.41.165 is the SNTP server (ntp2.hosteng.com) at Host Engineering.

 

Note: While it is reasonable to use the default time server for testing purposes, be aware that the uptime of the default time server can not be guaranteed. It is recommended that you install your own time server or select a publicly available time server for long-term use.

 

Note: Invoking the Element Browser (F9) for this field will bring up the IP Address Lookup utility that can find the IP Address for a given SNTP Server name.

 

UDP Port Number - the TCP/IP port number the SNTP Server uses to communicate. The default UDP Port Number of 123 is the default port number used by the SNTP protocol. This value can be any constant in the range of 1 to 65535

 

Network Timeout - specifies the maximum amount of time in milliseconds to allow the instruction to wait before signaling a completion. This value can be any constant in the range of 1 to 65535.

 


On Success: - designates one of the following two options if the SNTP Client operation is successful:

 

  • SET BIT - The specific BIT location will be SET OFF when the SNTP Client (NETTIME) instruction is first enabled, and then SET ON if the operation is successful. This value can be any writable bit location.
     

  • JMP to Stage - JMP to the specified Stage. The target Stage must be in the same Program as the SNTP Client (NETTIME) instruction, you cannot specify a Stage in a different Program. This selection will function the same as a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 

On Error: - designates one of the following two options if the SNTP Client operation is unsuccessful:
 

  • SET BIT - The specific BIT location will be SET OFF when the SNTP Client (NETTIME) instruction is first enabled, and then SET ON if the operation is unsuccessful. This value can be any writable bit location.
     

  • JMP to Stage - JMP to the specified Stage. The target Stage must be in the same Program as the SNTP Client (NETTIME) instruction, you cannot specify a Stage in a different Program. This selection will function the same as a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 


Status Display:

The red triangle in the upper left corner of the status display indicates this is a Fully Asynchronous instruction.

 

The gray triangle at the right end of the input leg indicates the input is edge triggered.

 

 


See Also:

 


Related Topics

 


Example Using Stages:

 


Rung Example: