FTP transfer request
This FP instruction sends a request to the FTP client specified in nTransferID to start the transfer.
Input
Set the FTP client ID
Values: 0–15
Output
Turns to TRUE under the following conditions:
if a timeout of the connection is exceeded
if an IP address is invalid
When an error occurs, check the system variable sys_iEthernetConnectionErrorCode for the error code number.
This instruction is not available in interrupt programs.
Before you execute the instruction, you need to specify the transfer settings using FP_FTP_SET_MODE or the setting dialog of the FTP client.
Before you execute the instruction, check if the system variable sys_bIsEthernetFTPClientReady is TRUE. If it is FALSE when executing the instruction, an error occurs.
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.
The instruction can only be executed when sys_bIsEthernetCableNotConnected is FALSE.
The instruction can only be executed when the transfer request flag for the specified transfer setting is "FALSE: No transfer request". When the transfer request flag is "TRUE: Transfer requested", an operation 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 the area specified using the index modifier exceeds the limit.
if a value specified for a parameter is outside the permissible range.
if the instruction is executed in an interrupt program
if the system variable sys_bIsEthernetFTPClientReady is FALSE when the instruction is executed.
if the transfer request flag for the specified transfer setting is "TRUE: Transfer requested" when the instruction is executed.
if a transfer setting that has not been configured with FP_FTP_SET_MODE or in the setting dialog of the FTP client is specified.
if the area specified using the index modifier exceeds the limit.
if a value specified for a parameter is outside the permissible range.
if the instruction is executed in an interrupt program
if the system variable sys_bIsEthernetFTPClientReady is FALSE when the instruction is executed.
if the transfer request flag for the specified transfer setting is "TRUE: Transfer requested" when the instruction is executed.
if a transfer setting that has not been configured with FP_FTP_SET_MODE or in the setting dialog of the FTP client is specified.
if the instruction is executed while the Ethernet cable is disconnected. sys_iEthernetConnectionErrorCode is set to "10: Ethernet cable disconnected".
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
iID10: INT:=10;
bTransferRequestError: BOOL:=FALSE;
bTransferRequest: BOOL:=FALSE;
END_VAR
VAR
iID10: INT:=10;
bTransferRequestError: BOOL:=FALSE;
bTransferRequest: BOOL:=FALSE;
END_VAR
If bTransferRequest changes from FALSE to TRUE and the system variable sys_bIsEthernetFTPClientReady is TRUE, the instruction is carried out. The FTP transfer is requested for the Ethernet unit 10.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 4 ;
NETWORK_BODY
B(B_CONTACT,,bTransferRequest,5,1,7,3,R);
B(B_VAROUT,,bTransferRequestError,40,2,42,4,);
B(B_VARIN,,iID10,23,2,25,4,);
B(B_F,FP_FTP_TRANSFER_REQUEST!,,25,0,40,4,,?DEN?DnID?AENO?CbError);
B(B_CONTACT,,sys_bIsEthernetFTPClientReady,16,1,18,3,);
L(1,2,5,2);
L(7,2,16,2);
L(18,2,25,2);
L(1,0,1,4);
END_NETWORK_BODY
END_NET_WORK
END_BODY
If DF(bTransferRequest) AND sys_bIsEthernetFTPClientReady then
FP_FTP_TRANSFER_REQUEST(nTransferID := iID10,
bError => bTransferRequestError);
End_if;