FB_FTP_OpenEX

FB_FTP_OpenEX 1:

With the function block FB_FTP_OpenEx a connection to an FTP server can be established. The handle returned can then be used to perform further actions on the FTP server. Additionally, the connection type - Passive or Active FTP - can be selected.

FB_FTP_OpenEX 2: Inputs

VAR_INPUT
sNetID    : T_AmsNetId     := '';
sHost     : T_IPv4Addr     := '127.0.0.1';
nPort     : UDINT          := 21;
eMode     : E_FTP_ConnMode := eConnMode_PASSIVE;
sUsername : STRING         := '';
sPassword : STRING         := '';
bExecute  : BOOL;
tTimeout  : TIME           := T#15s;
END_VAR

Name

Type

Description

sNetID

T_AmsNetId

A string containing the AMS network ID of the target device, at which the ADS command is directed.

sHost

T_IPv4Addr

A string containing the IPv4 address of the FTP server.

nPort

UDINT

FTP Port (default 21).

eMode

E_FTP_ConnMode

FTP connection type (Active / Passive).

sUsername

STRING

User name for FTP server authentication

sPassword

STRING

Password for FTP server authentication

bExecute

BOOL

The function block is executed with the rising edge.

tTimeout

TIME

Indicates the timeout period.

FB_FTP_OpenEX 3: Outputs

VAR_OUTPUT
bBusy  : BOOL;
bError : BOOL;
nErrID : UDINT;
hFTP   : T_HFTP;
END_VAR

Name

Type

Description

bBusy

BOOL

The command is in the process of being transmitted by ADS. No new command will be accepted as long as "bBusy" remains TRUE.

bError

BOOL

Becomes TRUE, as soon as an error occurs.

nErrID

UDINT

Returns the corresponding error code in the event of a set bError output.

hFTP

T_HFTP

Handle of the FTP connection.

Requirements

Development Environment

Target Platform

PLC Libraries to include

TwinCAT v3.0 Build 3102

PC or CX (x86)

Tc2_FTP