Header
Data log header bytes = header character bytes + 2 bytes
Header character bytes
● No data header and no timestamps = 7 bytes
● No data header and timestamps (has a timestamp header) = 21 bytes
● Data headers and no timestamps = number of character bytes in all column head text
● Data headers and timestamps (has a timestamp header) = number of character bytes in
Data
Data log data bytes = ((data bytes in one record + time stamp bytes) * number of records) +
12 bytes
Data bytes in one data record
The DataLogCreate DATA parameter points to a structure that assigns the number of data
fields and the data type of each data field for one data log record.
Multiply the number of occurrences for a given data type by the number of bytes required.
Repeat the process for each data type in a record and sum all the data bytes to get the total
of all data elements in one record.
Size of individual data elements
Log data is stored as character bytes in the CSV (comma separated values) file format. The
following table shows the number of bytes that are required to store each data element.
Data type Number of bytes (includes data plus one comma byte)
Bool
Byte
Word
DWord
Char
String
USInt
UInt
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
including separator commas
all column head text including separator commas +21 bytes
2
5
7
12
4
Example 1: MyString String[10]
The maximum string size is assigned as 10 characters.
Text characters + automatic padding with blank characters = 10 bytes
Opening and closing double quote + comma characters = 3 bytes
10 + 3 = 13 total bytes
Example 2: Mystring2 String
If no size is assigned with square brackets, then 254 bytes is allocated by
default.
Text characters + automatic padding with blank characters = 254 bytes
Opening and closing double quote + comma characters = 3 bytes
254 + 3 = 257 total bytes
5
7
Extended instructions
8.7 Recipes and Data logs
395