DTGetNTPServer

 Function Block - Read the NTP server address.

This function block is specific for PCMM2G only.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

FALSE, TRUE

N/A

No default

If TRUE, request to read the NTP server address.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

FALSE, TRUE

N/A

If TRUE, the command completed successfully.

Error

BOOL

FALSE, TRUE

N/A

If TRUE, an error has occurred.

ErrorID

DINT

No range

N/A

Indicates the error if the Error output is set to TRUE.

Error Codes

  • 23 = Internal error.
    See the controller log for details.
  • 15000 = Controller type does not support this function block.
  • 16200 = Could not read NTP server configuration file.

NTP Server

STRING

No range

N/A

The address of the NTP server used for clock synchronization.

Remarks

None

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

// read the NTP server address
Inst_DTGetNTPServer( bGetNTPServer );
if Inst_DTGetNTPServer.Done then
   bGetNTPServer := false;
   if NOT Inst_DTGetNTPServer.Error then
      NTPServer := Inst_DTGetNTPServer.NTPServer;
   else
      ErrorID := Inst_DTGetNTPServer.ErrorID;
   end_if;
end_if;

See Also