101BExtended instructions
8.7 Data logging
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
305
The DataLogCreate DATA parameter points to a structure that specifies the number of data
fields and the data type of each data field for one data log record. The table above gives the
bytes required in the CSV file for each data type. Multiply the number of occurrences of a
given data type by the number of bytes it requires. Do this for each data type in the record
and sum the number of bytes to get the total size of the data record. Add one byte for the
end of line character.
Size of a data log record = summation of bytes required for all data 1 (the end of line
character).
Calculate the memory requirement for an entire data log file
The RECORDS parameter of the DataLogCreate instruction sets the maximum number of
records in a data log file. When the data log file is created the maximum memory size is
allocated.
Size of data log file = (number of bytes in one record) x (number of records).
8.7.5
Data log example program
This Data log example program does not show all the program logic necessary to get sample
values from a dynamic process, but does show the key operations of the Data log
instructions. The structure and number of log files that you use depends on your process
control requirements.
Note
General usage of Data log files
Data log files are automatically opened after the DataLogCreate and DataLogNew File
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 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.