101BExtended instructions
8.7 Data logging
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
297
The NAME must be the name of a data log created by the DataLogCreate instruction. If only
the NAME is provided and the NAME specifies a valid data log, then the corresponding ID
will be returned (ID parameter as an output).
Note
General usage of data log files
Data log files are automatically opened after the DataLogCreate and DataLogNewFile
operations.
Data log files are automatically closed after a PLC run to stop transition or a PLC power
cycle.
A Data log file must be open before a new DataLogWrite operation is possible.
A maximum of eight data log files may be open at one time. More than eight data log files
may exist, but some of them must be closed so no more than eight are open.
Table 8- 127 Values of ERROR and STATUS
ERROR
STATUS (W#16#)
Description
0
0000
No error
0
0002
Warning: Data log file already open by this application program
0
7000
Call with no REQ edge: BUSY = 0, DONE = 0
0
7001
First call with REQ edge (working): BUSY = 1, DONE = 0
0
7002
N
th
call (working): BUSY = 1, DONE = 0
1
8070
All internal instance memory is in use.
1
8090
Data log definition is inconsistent with existing data log file.
1
8091
Name parameter is not a String reference.
1
8092
Data log does not exist.
1
80C0
Data log file is locked.
1
80C1
Too many open files: No more than eight opened data log files are allowed.
8.7.2.3
DataLogClose
Table 8- 128 DataLogClose instruction
LAD / FBD
SCL
Description
"DataLogClose_DB"(
req:=_bool_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
ID:=_dword_inout_);
Closes an open data log file. DataLogWrite operations to
a closed data log result in an error. No write operations
are allowed to this data log until another DataLogOpen
operation is performed.
A transition to STOP mode will close all open data log
files.
STEP 7 automatically creates the associated instance
DB when you insert the instruction.
2
In the SCL example, "DataLogClose_DB" is the name of the instance DB.