A Brief Introduction to TwinCAT PLC Control LD 17 ST lint (* comment *) GE 5 JMPC next LD idword EQ istruct.sdword STN test next: Modifiers and operators in IL In the IL language the following operators and modifiers can be used. Modifiers: C with JMP, CAL, RET: The instruction is only then executed if the result of the preceding expression is TRUE. N with JMPC, CALC, RETC: The instruction is only then executed if the result of the preceding expression is FALSE. N otherwise: Negation of the operand (not of the accumulator) Below you find a table of all operators in IL with their possible modifiers and the relevant meaning: You find a list of all IEC operators in the appendix.
Example of an IL program while using some modifiers: TwinCAT 2 PLC Control 17 Version: 1.0 Operator Modifiers Meaning LD N Make current result equal to the operand ST N Save current result at the position of the Operand S Put the Boolean operand exactly at TRUE if the current result is TRUE R Put the Boolean operand exactly at FALSE if the current result is TRUE AND N, ( Bitwise AND OR N, ( Bitwise OR XOR ( Bitwise exklusive OR ADD ( Addition SUB ( Subtraction MUL ( Multiplication DIV ( Division GT ( > GE ( >= EQ ( = NE ( LE ( LT ( JMP CN Jump to label CAL CN call function block RET CN Return from call of a function block ) Evaluate deferred operation