12 iec 61131-3 operators, 1 arithmetic operators, 1 add – Lenze DDS v2.3 User Manual

Page 271: 2 mul, 3 sub, 4 div, Drive plc developer studio

Advertising
background image

Drive PLC Developer Studio

IEC 61131-3 Operators

12-1

l

DDS EN 2.3

12

IEC 61131-3 operators

The DDS supports all IEC operators.

Contrary to standard functions, they are known implicitly throughout the entire project. Organization
unit implementations use operators like functions.

12.1

Arithmetic operators

Types:

The operands of the following arithmetic operators can be of type BYTE, WORD, DWORD, SINT, USINT,
INT

, UINT, DINT, UDINT and REAL.

12.1.1

ADD

Addition

It is also possible to add two TIME variables, the sum being again a time
(e.g. t#45s + t#50s = t#1m35s).

Examples
IL

ST

FBD

LD

7

ADD 2,4,7
ST

Var1

Var1 := 7+2+4+7;

12.1.2

MUL

Multiplication

Examples
IL

ST

FBD

LD

7

MUL 2,4,7
ST

Var1

Var1 := 7*2*4*7;

12.1.3

SUB

Subtraction

A TIME variable can also be subtracted from another TIME variable, the result being again of type
TIME

. Note that negative TIME values are not defined.

Examples
IL

ST

FBD

LD

7

SUB 2
ST

Var1

Var1 := 7-2;

12.1.4

DIV

Division

Examples
IL

ST

FBD

LD

8

DIV 2
ST

Var1

Var1 := 8/2;

Show/Hide Bookmarks

Advertising