101BExtended instructions
8.7 Data logging
S7-1200 Programmable controller
296
System Manual, 11/2011, A5E02486680-05
8.7.2.2
DataLogOpen
Table 8- 125 DataLogOpen instruction
LAD / FBD
SCL
Description
"DataLogOpen_DB"(
req:=_bool_in_,
mode:=_uint_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_word_out_,
name:=_string_inout_,
ID:=_dword_inout_);
Opens a pre-existing data log file. A data log must be
opened before you can write new records to the log. Data
logs can be opened and closed individually. A maximum
of eight data logs can be open at the same time.
STEP 7 automatically creates the associated instance DB
when you insert the instruction.
2
In the SCL example, "DataLogOpen_DB" is the name of the instance DB.
Table 8- 126 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)
MODE
IN
UInt
Operation mode:
0 - Append to existing data (Default value)
1 - Clear all existing records
NAME
IN
Variant
Name of an existing data log: This variant only supports a String data type
and can only be located in local, DB, or M memory. (Default value: ' ')
ID
In/Out
DWord
Numeric identifier of a data log. (Default value: 0)
Note: Symbolic name access for this parameter is not allowed.
DONE
OUT
Bool
The DONE bit is TRUE for one scan, after the last request was completed
with no error. (Default value: False)
BUSY
OUT
Bool
0 - No operation in progress
1 - Operation on progress
ERROR
OUT
Bool
The ERROR bit is TRUE for one scan, after the last request was
terminated with an error. The error code value at the STATUS parameter
is valid only during the single scan where ERROR = TRUE.
STATUS
OUT
Word
Execution condition code (Default value: 0)
You can provide either the NAME or an ID (ID parameter as an input) of a pre-existing data
log. If you provide both parameters and a valid ID does correspond to the NAME data log,
then the ID is used, and the NAME ignored.