Description
The "Compare data type of an indirectly addressed DB for UNEQUAL with a data type" instruction is used to query which data type the data block does not have, that the tag of the DB_ANY data type addresses. You compare the data type of the DB addressed by the tag at the IN1 parameter either with the data type of another tag or directly with the data type at the IN2 parameter for "Not equal".
The tag at the IN1 parameter must have the DB_ANY data type. The tag at the IN2 parameter, for example, can be a PLC data type, a system data type, an axis or an FB.
If the condition of the comparison is fulfilled, the instruction returns the result of logic operation (RLO) "1". If the comparison condition is not fulfilled, the instruction returns RLO "0".
Parameter
The following table shows the parameters of the instruction:
|
Parameter |
Declaration |
Data type |
Memory area |
Description |
|
|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
||||
|
IN1 |
Input |
DB_ANY |
L (The declaration is possible in the "Input", "InOut" and "Temp" sections of the block interface.) |
First operand |
|
|
IN2 |
Input |
TYPE_ID |
I, Q, M, D, L |
I, Q, M, D, L, P |
Second operand |
|
OUT |
Output |
BOOL |
I, Q, M, D, L |
I, Q, M, D, L |
Result of comparison |
You can find additional information on valid data types under "See also".
Example
The following example shows how the instruction works:
The "TagOut" output is set when the following conditions are fulfilled:
-
The operand "TagIn" has the signal state "1".
-
The condition of the comparison instruction is fulfilled, i.e. the data type of the #InputDBAny operand addressed DB is unequal with the TO_SpeedAxis data type.
The "TagOut" output is not set when the following conditions are fulfilled:
-
The number of the data block is "0".
-
The data block does not exist.
-
The data block is an ARRAY DB.
-
The data block contains a tag of the data type UDT (PLC data type).