EasyManua.ls Logo

Siemens SIMATIC S7-1200 - 9.9.2 Data logs; 9.9.2.1 Data log record structure

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Extended instructions
9.9 Recipes and Data logs
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
509
9.9.2
Data logs
Your control program can use the Data log instructions to store run-time data values in
persistent log files. The CPU stores data log files in flash memory (CPU or memory card) in
standard CSV (Comma Separated Value) format. The CPU organizes the data records as a
circular log file of a pre-determined size.
You use the Data log instructions in your program to create, open, write a record to, and
close the log files. You decide which program values to log by creating a data buffer that
defines a single log record. The CPU uses your data buffer as temporary storage for a new
log record. Your control program moves new current values into the buffer during runtime.
When the program has updated all of the current data values, it can then execute the
DataLogWrite instruction to transfer data from the buffer to a data log record.
You can open, edit, save, rename, and delete data log files from the File Browser page of
the Web Server. You must have read privileges to view the file browser and you must have
modify privileges to edit, delete, or rename data log files.
9.9.2.1
Data log record structure
The DATA and HEADER parameters of the DataLogCreate instruction assign the data type
and the column header description of all data elements in a log record.
DATA parameter for the DataLogCreate instruction
The DATA parameter points to memory used as a temporary buffer for a new log record and
must be assigned to an M or DB location.
You can assign an entire DB (derived from a PLC data type that you assign when the DB is
created) or part of a DB (the specified DB element can be any data type, data type structure,
PLC data type, or data array).
Structure data types are limited to a single nesting level. The total number of data elements
declared should correspond to the number of columns specified in the header parameter.
The maximum number of data elements you can assign is 253 (with a timestamp) or 255
(without a timestamp). This restriction keeps your record inside the 256 column limit of an
Excel sheet.
The DATA parameter can assign either retentive or non-retentive data elements in a
"Standard" (compatible with S7-300/400) or "Optimized" DB type.
In order to write a Data log record you must first load the temporary DATA record with new
process values and then execute the DataLogWrite instruction that saves new record values
in the Datalog file.
HEADER parameter for the DataLogCreate instruction
The HEADER parameter points to column header names for the top row of the data matrix
encoded in the CSV file. HEADER data must be located in DB or M memory and the
characters must follow standard CSV format rules with commas separating each column
name. The data type may be a string, byte array, or character array. Character/byte arrays
allow increased size, where strings are limited to a maximum of 255 bytes. The HEADER
parameter is optional. If the HEADER is not assigned, then no header row is created in the
Data log file.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals