Set retry settings to default values
This FP instruction sets the retry settings for NTP server time synchronization requests to the default values.
Output
Set to TRUE when the operation ends abnormally without execution, e.g. when sys_bIsEthernetInitializing is TRUE
When an error occurs, check the system variable sys_iEthernetConnectionErrorCode for the error code number.
This instruction is not available in interrupt programs.
The retry settings of the time synchronization request for the NTP server will be set to the following default values:
The data that is already set in the system registers ( ) is invalid and the NTP time synchronisation request is executed at the time that is specified by this instruction.
The PLC returns to the settings from the system registers in the following cases:
The power is turned off.
You switch from PROG mode to RUN mode.
You switch to a different project.
The setting data will not be lost even if the instruction FP_IPV4_SET_ADDRESS is executed.
Before you execute the instruction, make sure that sys_bIsEthernetInitializing is FALSE. sys_bIsEthernetInitializing turns to TRUE when the instruction is executed. When you execute the instruction while sys_bIsEthernetInitializing is TRUE, an error occurs.
When this instruction has been executed successfully, the system variables sys_bIsCarry and sys_iEthernetConnectionErrorCode are reset.
When an error occurs, check the system variable sys_iEthernetConnectionErrorCode for the error code number.
if a value specified for a parameter is outside the permissible range.
if the instruction is executed in an interrupt program
if the system is synchronizing the time with the NTP server.
if a value specified for a parameter is outside the permissible range.
if the instruction is executed in an interrupt program
if the system is synchronizing the time with the NTP server.
if the instruction is executed during the initialization of Ethernet, sys_iEthernetConnectionErrorCode is set to "11: Ethernet is being initialized".
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
bError: BOOL:=FALSE;
bEnable: BOOL:=FALSE;
END_VAR
When the system variable sys_bIsEthernetInitializing is FALSE and the variable bEnable is set to TRUE, the function is carried out.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_CONTACT,,sys_bIsEthernetInitializing,6,1,8,3,N);
B(B_CONTACT,,bEnable,14,1,16,3,);
B(B_F,FP_NTP_SET_RETRY_SETTINGS_DEFAULT!,,18,0,37,4,,?DEN?AENO?AbError);
B(B_VAROUT,,bError,37,2,39,4,);
L(1,0,1,5);
L(1,2,6,2);
L(8,2,14,2);
L(16,2,18,2);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
if NOT (sys_bIsEthernetInitializing) AND (bEnable) then
FP_NTP_SET_RETRY_SETTINGS_DEFAULT(bError => bError);
end_if;