24.01.2015 Views

PLC Programming

  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix E: Operators and Library Modules Overview<br />

Appendix E: Operators and Library Modules Overview<br />

The table shown below shows an overview on the operators, which are available in CoDeSys resp. in the<br />

libraries Standard.lib and Util.lib. You find there the notation for ST and IL. For IL also the supported<br />

modificators are listed.<br />

Take note that for the 'IL operator' column: Only the line in which the operator is used will be displayed. A<br />

prerequisite is that the (first) required operand have been successfully loaded in the preceding line (e.g. LD in).<br />

The 'Mod. IL' column shows the possible modifiers in IL:<br />

C<br />

N<br />

N<br />

The command is only executed if the result of the preceding expression is TRUE.<br />

for JMPC, CALC, RETC: The command is only executed if the result of the preceding<br />

expression is FALSE.<br />

otherwise: negation of the operand (not of the accumulator)<br />

( Operator enclosed in brackets: only after the closing bracket is reached will the operation<br />

preceding the brackets be carried out.<br />

Please obtain a detailed description of usage from the appropriate Appendices concerning IEC<br />

operators integrated into CoDeSys resp. the libraries.<br />

Operators in CoDeSys:<br />

in ST in AWL Mod.<br />

AWL<br />

'<br />

..<br />

[ ]<br />

Description<br />

String delimiters (e.g. 'string1')<br />

Size of Array range (e.g. ARRAY[0..3] OF INT)<br />

: Delimiter between Operand and Type in a<br />

declaration (e.g. var1 : INT;)<br />

; Termination of instruction (e.g. a:=var1;)<br />

^<br />

Dereferenced Pointer (e.g. pointer1^)<br />

LD var1 N Load value of var1 in buffer<br />

:= ST var1 N Store actual result to var1<br />

S boolvar<br />

R boolvar<br />

Set boolean operand boolvar exactly then to TRUE,<br />

when the actual result is TRUE<br />

Set boolean operand boolvar exactly then to FALSE,<br />

when the actual result is TRUE<br />

JMP label CN Jump to label<br />

CAL prog1 CN Call program prog1<br />

CAL inst1 CN Call function block instance inst1<br />

(vx, vy,..) vx, vy CN Call function fctname and transmit variables vx, vy<br />

RETURN RET CN Leave POU and go back to caller<br />

CoDeSys V2.3 10-61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!