Time protocol (SNTP)
(from firmware version BB)
The Simple Network Time Protocol is used to synchronize clocks via the internet. The BC9000 can be synchronized with a time server.
Download library:
(tciputilitiesbc.zip)
FUNCTION_BLOCK FB_SNTP
From firmware version BA:
If an empty string is entered in variable sSntpServer, the BC9000 will search for a time server. If no server is found the process is terminated. If a time server is found, the IP address can be displayed via the cCurrSntpServer variable. A rising edge of bStart activates the function block and starts the time server query.
From firmware version BB:
If an IP address is entered the Bus Terminal Controller uses the SNTP protocol. If an empty string is transferred, the time protocol (UDP port 37) is used.
VAR_INPUT
bStart :BOOL;
sSntpServer :STRING(15);
tTimeOut :TIME;
bOpen: A positive edge starts the function block
sSntpServer: SNTP server entry. If an empty string is entered, the time protocol is used (UDP port 37)*.
tTimeOut: TMOut after which the process is to be terminated
VAR_OUTPUT
bBusy :BOOL;
bError :BOOL;
iErrorId :WORD;
tTime :DT;
cCurrSntpServer :STRING(15);
bBusy: The function block is active as long it is TRUE.
bError: Error bit.
iErrorId: Error number.
tTime: Time and date.
sCurrSnptServer: IP address of the SMTP server
Return parameter iErrId | Meaning |
---|---|
0 | No error |
> 0 | Error number (#not documented#) |
Download sample:
(sntp.zip)