Reference programming TYPE SubInt : INT (-4095..4095); END_TYPE Direct declaration of a variable with a subrange type: VAR i1 : INT (-4095..4095); i2: INT (5...10):=5; ui : UINT (0..10000); END_VAR If a constant is assigned to a subrange type (in the declaration or in the implementation) that does not apply to this range (e.g. 1:=5000), an error message is issued. In order to check for observance of range boundaries at runtime, the functions CheckRangeSigned [ } 221] or CheckRangeUnsigned [ } 222] must be introduced. 7.2 Operators TwinCAT PLC Control supports all IEC Operators. In contrast with the standard functions, these operators are recognized implicitly throughout the project.
Operators are used like functions in POU implementation. 7.2.1 Overview IEC Operators The table shown below shows the operators in ST and IL with the available modifiers in IL. Take note that for the 'IL operator' column: Only the line in which the operator is used will be displayed. A prerequisite is that the (first) required operand have been successfully loaded in the preceding line (e.g. LD in). The 'Mod. IL' column shows the possible modifiers in IL: Please obtain a detailed description of usage from the Appendix. TX1200 190 Version: 1.3 C The command is only executed if the result of the preceding expression is TRUE. N for JMPC, CALC, RETC:
The command is only executed if the result of the preceding expression is FALSE. N otherwise: negation of the operand (not of the accumulator) ( Operator enclosed in brackets: only after the closing bracket is reached will the operation preceding the brackets be carried out.