Time protocol (SNTP)

(BX9000 from firmware version 1.12, BC9050, BC9x20)

The Simple Network Time Protocol is used to synchronize clocks via the internet. The BX9000 can be synchronized with a time server.

Time protocol (SNTP) 1:
Function block FB_SNTP

FUNCTION_BLOCK FB_SNTP

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: rising 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

Time protocol (SNTP) 2: Download (sample file)

bx9000_sntp.prx