FB_FTP_FileUpload

FB_FTP_FileUpload 1:

Files can be transferred from the ADS-Device to an FTP server with the function block FB_FTP_FileUpload. This function block uses an already opened connection to an FTP server

FB_FTP_FileUpload 2: Inputs

VAR_INPUT
sNetID   : T_AmsNetId := '';
hFTP     : T_HFTP;
sSrcFile : T_MaxString:= '';
sDesFile : T_MaxString:= '';
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.

hFTP

T_HFTP

Handle of the FTP server.

sSrcFile

T_MaxString

Source file to be copied to the FTP server.

sDesFile

T_MaxString

Destination filename with path specification.

bExecute

BOOL

The function block is executed with the rising edge.

tTimeout

TIME

Indicates the timeout period.

FB_FTP_FileUpload 3: Outputs

VAR_OUTPUT
bBusy     : BOOL;
bError    : BOOL;
nErrID    : UDINT;
nProgress : UDINT;
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 ADS error code if the bError output is set.

nProgress

UDINT

Displays the current status of the transmission in percent.

Requirements

Development Environment

Target Platform

PLC Libraries to include

TwinCAT v3.0 Build 3102

PC or CX (x86)

Tc2_FTP