Drive plc developer studio, Programming languages – Lenze DDS v2.3 User Manual

Page 41

Advertising
background image

Drive PLC Developer Studio

Programming languages

4-3

l

DDS EN 2.3

The table lists some IL operators along with possible modifiers and their respective meaning:

Operator

Modifiers

Meaning

LD

N (=”NOT”)

Load

Load instruction

ST

N

Store

Save the current result in the operand location

S

Set

Set Boolean operand to TRUE exactly if the current result is TRUE.

R

Reset

Set Boolean operand to FALSE exactly if the current result is TRUE.

AND

N,(

Bit-by-bit AND

OR

N,(

Bit-by-bit OR

XOR

N,(

Bit-by-bit exclusive OR

ADD

(

Addition

SUB

(

Subtraction

MUL

(

Multiplication

DIV

(

Division

GT

(

>

Greater than

GE

(

>=

Greater than or equal to

EQ

(

=

Equal to

NE

(

<>

Not equal to

LE

(

<=

Less than or equal to

LT

(

<

Less than

JMP/JMPC

N

Jump

Jump to label

CAL/CALC

N

Call

Call program or function block

RET/RETC

N

Return Return from calling a function block

)

Evaluate operation that has been deferred

For a more comprehensive IEC operator list refer chapter 12.

Example

IL program using several modifiers

LD

TRUE

(* Load TRUE to the accumulator *)

ANDN

BOOL1 (* Execute AND with the negated value

of the variable BOOL1 *)

JMPC

label (* If the result was TRUE

jump to the label “label” *)

LDN

BOOL2 (* save the negated value of *)

ST

ERG (* BOOL2 in ERG *)

Label:
LD

BOOL2 (* save the value of *)

ST

ERG (* BOOL2 in ERG *)

IL also allows the setting of parentheses after an operation. The value in parentheses is taken as
operand.

Example 1

Example 2

LD

2

LD

2

MUL

2

MUL

(2

ADD

3

ADD

3

)

ST

Result

ST

In example 1, the value of Result is 7.

In example 2 with parentheses the value for Result is 10, because the operation MUL will
only be evaluated on reaching ” )” ; the operand for MUL is 5.

Show/Hide Bookmarks

Advertising