101BExtended instructions
8.7 Data logging
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
301
You can execute the DataLogNewFile instruction when a data log becomes full or is deemed
completed and you do not want to lose any data that is stored in the data log. A new empty
data log file can be created based on the structure of the full Data log file. The header record
will be duplicated from the original data log with the original data log properties (DATA record
buffer, data format, and timestamp settings). The original Data log file is implicitly closed and
the new Data log file is implicitly opened.
DataLogWrite parameter trigger: Your program must monitor the ERROR and STATUS
parameters of each DataLogWrite operation. When the final record is written and a data log
is full, the DataLogWrite ERROR bit = 1 and the DataLogWrite STATUS word = 1. These
ERROR and STATUS values are valid for one scan only, so your monitoring logic must use
ERROR = 1 as a time gate to capture the STATUS value and then test for STATUS = 1 (the
data log is full).
DataLogNewFile operation: When your program logic gets the data log is full signal, this
state is used to activate a DataLogNewFile operation. You must execute DataLogNewFile
with the ID of an existing (usually full) and open data log, but a new unique NAME
parameter. After the DataLogNewFile operation is done, a new data log ID value is returned
(as an output parameter) that corresponds to the new data log name. The new data log file is
implicitly opened and is ready to store new records. New DataLogWrite operations that are
directed to the new data log file, must use the ID value returned by the DataLogNewFile
operation.
Note
A DataLogNewFile operation extends over many program scan cycles. The actual time
required for the log file creation depends on the record structure and number of records.
Your program logic must monitor and catch the DataLogNewFile DONE bit's transition to the
TRUE state, before the new data log can be used for other data log operations.
Table 8- 136 Values of ERROR and STATUS
ERROR
STATUS (W#16#)
Description
0
0000
No error
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
Invalid file name
1
8091
Name parameter is not a String reference.
1
8092
Data log does not exist.
1
8093
Data log already exists.
1
8097
Requested file length exceeds file system maximum.
1
80B3
Insufficient load memory available.
1
80B4
MC is write protected.
1
80C1
Too many open files.