Configuration, programming
4.7 FTP communication
CP 1543-1
48
Operating Instructions, 12/2019, C79000-G8976-C289-08
FTP commands in the "CMD" parameter
The following table shows you the significance of the commands of the "CMD" parameter
and which UDTs you use to supply the job blocks.
Table 4- 3
Command types
CMD (command type) Relevant job blocks /
UDT
Meaning / handling
0 (NOOP)
*
The called FB does not execute any actions. The status codes are
set as follows when these parameters are supplied:
DONE=1; ERROR=0; STATUS=0
1 (CONNECT)
FTP_CONNECT_IPV4
FTP_CONNECT_IPV6
FTP_CONNECT_NAME
FTP connection establishment
With this command, the FTP client establishes an FTP connection to
an FTP server (port 21).
The connection is available under the connection ID specified here
for all further FTP commands. Data is then exchanged with the FTP
server specified for this user.
2 (STORE)
FTP_FILENAME
This function call transfers a data block (file DB) from the FTP client
(S7-CPU) to the FTP server.
Caution: If the file (file DB) already exists on the FTP server, it will be
overwritten.
3 (RETRIEVE)
FTP_FILENAME
This function call transfers a file from the FTP server to the FTP client
(S7-CPU).
Caution: If the data block (file DB) on the FTP client already contains
a file, it will be overwritten.
4 (DELETE)
FTP_FILENAME
With this function call, you delete a file on the FTP server.
5 (QUIT)
*
With this function call, you close the FTP connection specified in "ID".
6 (APPEND)
FTP_FILENAME
Similar to "STORE", the "APPEND" command saves a file on the
FTP server. With "APPEND", the file on the FTP server is, however,
not overwritten. The new content is appended to the existing file.
If the file (file DB) does not exist on the FTP server, it will be created.
7 (RETR_PART)
FTP_FILENAME_PART Using the "RETR_PART" command (retrieve part) , you can request
a section of a file from the FTP server.
If very large files are involved, this allows you to restrict the read to
the part you currently require.
To do this, you need to know the structure of the file.
Enter the required part of the file using the two parameters "OFFSET"
and "LEN" in FB40.
* With the command types 0 (NOOP) and 5 (QUIT) a freely selectable job block (UDT) must be specified. This is not evalu-
ated.