Configuration, programming
4.7 FTP communication
CP 1543-1
58
Operating Instructions, 12/2019, C79000-G8976-C289-08
4.7.2.5
Structure of the data block (file DB) for FTP client operation
How it works
To transfer data with FTP, create data blocks (file DBs) on the CPU of your S7 station.
These data blocks must have certain structure to allow them to be handled as transferable
files by the FTP services. They consist of the following sections:
●
Section 1: File DB header (has a fixed length of 20 bytes)
●
Section 2: User data as "Array [..] of Byte" or "Array [..] of Char" (has a variable length
and structure)
Data consistency
Make sure that you do not access the same file DB more than once at the same time.
Creating a file DB
1.
Create a new data block in STEP 7.
2.
Open the block editor.
3.
In the block editor of the DB, select the line you want to use as the start line for the file
DB.
4.
In the "Data type" column, enter the type "FILE_DB_HEADER" using the keyboard.
A data structure with the header structure required for the file DB is created.
5.
Set the "WRITEACCESS" parameter to "true" to enable access.
6.
Enter a value for the length of the user data at the "MAX_LENGTH" parameter.
7.
Below this, create a data field of the type "Array [..] of Byte" or "Array [..] of Char" for the
user data to be sent.
The size of the field must match the specification of "MAX_LENGTH" in the header.