Extended instructions
9.9 Recipes and Data logs
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
517
Data log creation operations must be complete, before starting a data log write operation
DataLogCreate and DataLogNewFile log file creation operations extend 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
DONE bit's transition to the TRUE state that signals the completion of a log file creation. If a
DataLogWrite instruction executes before a data log creation operation is complete, then
the write operation does not write a new data log record.
Note
Effect of data logs on internal CPU memory
Each data log write consumes at a m
inimum 2 KB of memory. If your program writes small
amounts of data frequently, it is consuming at least 2 KB of memory on each write. A better
implementation would be to accumulate the small data items in a data block (DB), and to
write the data block to
the data log at less frequent intervals.
If your program writes many data log entries at a high frequency, consider using a
replaceable SD memory card.
Potential for data log data loss during a CPU power failure
If there is a power failure during an incomplete DataLogWrite operation, then the data
record being transferred to the data log could be lost.
Table 9- 208 Values of ERROR and STATUS
0 0001 Indicates that the data log is full: Each data log is created with a specified maxi-
mum number of records. The last record of the maximum number has been
written. The next write operation will overwrite the oldest record.
Call with no REQ edge: BUSY = 0, DONE = 0
First call with REQ edge (working): BUSY = 1, DONE = 0
th
call (working): BUSY = 1, DONE = 0
All internal instance memory is in use.
Data log file is not open (for explicit open mode only).