DTGetNTPServer
Function Block
A function block groups an algorithm and a set of private data. It has inputs and outputs. - Read the NTP
"Network Time Protocol"
A networking protocol for clock synchronization between computer systems.
The PCMM2G can be configured to synchronize with public NTP time servers over the internet or a local NTP time server for networks that are not connected to the internet. server address.
This function block is specific for PCMM2G only.
Inputs
|
Input |
Data Type |
Range |
Unit |
Default |
Description |
|---|---|---|---|---|---|
|
Execute |
BOOL |
TRUE, FALSE |
N/A |
No default |
If TRUE, request to read the NTP server address. |
Outputs
|
Output |
Data Type |
Range |
Unit |
Description |
|---|---|---|---|---|
|
Done |
BOOL |
TRUE, FALSE |
N/A |
If TRUE, the command completed successfully. |
|
Error |
BOOL |
TRUE, FALSE |
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
|
|
NTPServer |
STRING |
No range |
N/A |
The address of the NTP server used for clock synchronization. |
Remarks
None
FBD Language
FFLD Language
IL Language
Not available.
ST Language
// 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





