FB_FTP_FileListEx
You can read a list of file- and foldernames from a FTP-Server with this function block FB_FTP_FileListEx. This function block uses an existing connection to a FTP-Server. This function block returns in contrast to FB_FTP_FileList more detailed information about the files.
VAR_INPUT
VAR_INPUT
sNetID : T_AmsNetId := '';
hFTP : T_HFTP;
sMask : T_MaxString := '';
bRawValues : BOOL;
nIndex : UDINT;
pList : UDINT;
cbList : UDINT;
bExecute : BOOL;
tTimeout : TIME := T#20s;
END_VAR
sNetID : Is a string containing the AMS network identifier of the target device to which the ADS command is directed.
hFTP : Handle to a FTP Server.
sMask : Searchmask to filter the files.
Beispiel | |
---|---|
*.* | Read all filenames |
* | Read all filenames and all foldernames |
*.txt | Read all filenames with the extension "TXT" |
\Test\*.* | Read all filenames of the subfolder Test |
bRawValues : The format of the returning filelist.
bRawValues := TRUE information will be returned as an T_MaxString array.
bRawValues := FALSE informationen will be returned as an ST_FTP_FileDetails array. (not supported for every FTP Server)
nIndex : Index of the first read filename.
pList : Pointer to a stringarray where the filenames will be stored
cbList : The sizeof the stringarray in bytes.
bExecute : The command is executed with the rising edge.
tTimeout : States the time before the function is cancelled.
VAR_OUTPUT
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrID : UDINT;
nItems : UDINT;
END_VAR
bBusy : The command is in the process of being transmitted by ADS. No new command will be accepted as long as "bBusy" remains TRUE.
bError : Becomes TRUE, as soon as an error occurs.
nErrID : Supplies the ErrorCode when the bError output is set.
nItems : Shows the number of all founded files or folders.
Requirements
Development environment | Target system type | PLC libraries to be linked |
---|---|---|
TwinCAT v2.10.0 | PC oder CX (x86) | TcFTPClient.Lib |
TwinCAT v2.10.0 | CX (ARM) |