Extended instructions
9.9 Recipes and Data logs
S7-1200 Programmable controller
512 System Manual, V4.2, 09/2016, A5E02486680-AK
The CPU creates a data log file with a pre-determined fixed sized based on the RECORDS
and DATA parameters and organizes the data records as a circular log file. The
DataLogWrite instruction appends new records to the data log file until it stores the
maximum number of records that is specified by the RECORDS parameter. The next record
written will overwrite the oldest record. Another DataLogWrite operation will overwrite the
next oldest data record and so on.
Memory resource usage:
● The data logs consume only load memory.
● The size of all data logs combined is limited by the available resources of load memory.
Only eight data logs can be open at one time. You can manage your data logs from the
File Browser (Page 1037) standard Web page. See the description of this standard Web
page for guidelines on how many data logs to maintain at a time.
● The maximum possible number for the RECORDS parameter is the limit for an UDint
number (4,294,967,295). The actual limit for the RECORD parameter depends on the
size of a single record, the size of other data logs, and the available resources of load
memory. In addition, Excel limits the number of rows allowed in an Excel sheet.
Note
Data log creation execution 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 t
o the TRUE state that signals the completion of a log file creation. If
the user program executes a DataLogWrite instruction before a data log creation
operation is complete, then the write operation will fail to write a new data log record as
expected.
In certain situations when a very fast program scan is running, data log creation can take
an extended time. If the long creation time is too slow, you should ensure that the
checkbox for the Enable minimum cycle time for cyclic OBs is active, and the minimum
cycle time is set to one ms or greater. Refer to Configuring the cycle time and
communication load (Page 109) for more information.
Note
The DataLogNewFile instruction copies an existing data log's record structure
If you want to prevent overwriting any data records, then you can use the DataLogNewFile
instruction to create a new data log based on the current data log, after the current data lo
g
has stored the maximum number of records. New data records are stored in the new data
log file. The old data log file and record data remain stored in flash memory.