EasyManua.ls Logo

Siemens SIMATIC S7-1200

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...
Basic instructions
8.7 Conversion operations
S7-1200 Programmable controller
300 System Manual, V4.2, 09/2016, A5E02486680-AK
Err
(W#16#...)
Description
8132 The data block is too short and not an Array data block (second
access).
8134
The data block is write-protected
8150 The data type Variant at parameter IN provides the value "0". To
receive this error message, the "Handle errors within block" block
property must be activated. Otherwise the CPU changes to STOP
mode and sends the error code 16#252C
8154
The data block has the incorrect data type.
*You can display error codes in the program editor as integer or hexadecimal values.
8.7.6.2
DB_ANY_TO_VARIANT (Convert DB_ANY to VARIANT)
You use the "DB_ANY to VARIANT" instruction to read the number of a data block that
meets the requirements listed below. The operand at the IN parameter has the data type
DB_ANY, which means you do not need to know during program creation which data block is
to be read. The instruction reads the data block number during runtime and writes it to the
function result RET_VAL by means of a VARIANT pointer.
Table 8- 125 DB_ANY_TO_VARIANT instruction
LAD / FBD
SCL
Description
Not available
RET_VAL :=
DB_ANY_TO_VARIANT(
in := _db_any_in_,
err => _int_out_);
Reads the data block number from the Variant IN parameter and
stores it in the function result, which is of the type Variant
Table 8- 126 Parameters for the DB_ANY_TO_VARIANT instruction
Parameter
Data type
Description
IN
DB_ANY
Variant that contains the data block number
RET_VAL Variant Output DB_ANY data type that contains the
converted data block number
ERR
Int
Error information
Table 8- 127 ENO status
ENO
Condition
Result
1 No error Instruction converts the data block number in
the variant and stores it in the function DB_ANY
output
0 Enable input EN has the signal state "0" or the IN
parameter is invalid.
Instruction does nothing.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals