101BExtended instructions
8.7 Data logging
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
293
8.7.2
Program instructions that control Data logs
8.7.2.1
DataLogCreate
Table 8- 122 DataLogCreate instruction
LAD/FBD
SCL
Description
"DataLogCreate_DB"(
req:=_bool_in_,
records:=_udint_in_,
format:=_uint_in_,
timestamp:=_uint_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
name:=_string_inout_,
ID:=_dword_inout_,
header:=_variant_inout_,
data:=_variant_inout_);
Creates and initializes a data log file. The
file is created in the PLC \DataLogs
directory, named by the NAME
parameter, and implicitly opened for write
operations. You can use the Data log
instructions to programmatically store
run-time process data in flash memory of
the CPU.
STEP 7 automatically creates the
associated instance DB when you insert
the instruction.
2
In the SCL example, "DataLogCreate_DB" is the name of the instance DB.
Table 8- 123 Data types for the parameters
Parameter and type
Data type
Description
REQ
IN
Bool
A low to high (positive edge) signal starts the operation. (Default value:
False)
RECORDS
IN
UDint
The maximum number of data records the circular data log can contain
before overwriting the oldest entry:
The header record is not included. Sufficient available PLC load memory
must exist in order to successfully create the data log. (Default value: 1)
FORMAT
IN
UInt
Data log format:
0: Internal format (not supported)
1: Comma separated values "csv-eng" (Default value)
TIMESTAMP
IN
UInt
Data time stamp format: Column headers for date and time fields are not
required. The time stamp uses the system time (Coordinated Universal Time
- UTC) and not the local time.
0: No time stamp
1: Date and time stamp (Default value)
NAME
IN
Variant
Data log name: You provide the name. This variant only supports a String
data type and can only be located in local, DB, or M memory. (Default value:
' ')
The string reference is also used as the name of the data log file. The name
characters must follow the Windows file system naming restrictions.
Characters \ / : * ? " < > | and the space character are not allowed.