Configuration, programming
4.7 FTP communication
CP 1543-1
Operating Instructions, 12/2019, C79000-G8976-C289-08
59
File DB header for FTP client mode
The file DB header described here is identical to the file DB header described for server
mode.
Parameter
Type
Value / meaning
Supply
EXIST
BOOL
The EXIST bit indicates whether
the user data area contains valid
data.
The retrieve FTP command exe-
cutes the job only when EXIST=1.
•
0: The file DB does not con-
tain valid user data (file does
not exist).
•
1: The file DB contains valid
user data (file exists).
The DELETE FTP command sets
EXIST=0.
The STORE FTP command sets
EXIST=1.
LOCKED
BOOL
The LOCKED bit is used to re-
strict access to the file DB.
•
0: The file DB can be ac-
cessed.
•
1: The file DB is locked.
The "STORE" and "RETRIEVE" FTP
commands set LOCKED=1 when they
are executed if the bit was previously at
0.
The user program on the S7 CPU can
also set or reset LOCKED during write
access to achieve data consistency.
This results in mutual locking between
the user program and FTP handling to
ensure consistency.
Recommended sequence in the user
program:
1.
Check LOCKED bit (if = 0)
2.
Set WRITEACCESS bit = 0
3.
Check LOCKED bit (if = 0)
4.
Set LOCKED bit = 1
5.
Write data
6.
Set LOCKED bit = 0
NEW
BOOL
The NEW bit indicates whether
data has been modified since the
last read access.
•
0: The content of the file DB is
unchanged since the last write
access. The user program of
the S7 CPU has registered the
last modification.
•
1: The user program of the S7
CPU has not yet registered
the last write access.
After execution, the "RETRIEVE" FTP
command sets NEW=1.
After reading the data, the user program
in the S7 CPU must set NEW=0 to allow
a new "RETRIEVE" command.