-

Semantic Error: Wrong or mismatching operand data types.

In an ST code worksheet, the data types of operands used in a statement do not match. In the error message, the mismatching data type as well as the expected data type are specified.

Depending on the used operator, particular operand data types are expected.

OperatorExpected operands data types
Logical operations.
Operators: AND, &, OR, XOR, NOT
ANY_BIT ‣ Generic Data Types according to IEC 61131-3
×‣ Generic Safety-Related Data Types
×
Arithmetic operations.
Operators: +, -, *, /
ANY_NUM ‣ Generic Data Types according to IEC 61131-3
×‣ Generic Safety-Related Data Types
×
Negation.
Operators: NEG
ANY_NUM ‣ Generic Data Types according to IEC 61131-3
×‣ Generic Safety-Related Data Types
×
Modulo operation.
Operator: MOD
ANY_INT ‣ Generic Data Types according to IEC 61131-3
×‣ Generic Safety-Related Data Types
×
Comparison.
Operator: <, <=, =>, >
ANY_ELEMENTARY ‣ Generic Data Types according to IEC 61131-3
×‣ Generic Safety-Related Data Types
×

Further Info
For information on the correct ST syntax refer to the topic "ST code objects".