Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
10
Добавлен:
11.10.2020
Размер:
3.39 Mб
Скачать

WAGO-I/O-PRO 32 V2.2 Overview

21

Languages

 

 

 

2.3.10Resources

You need the resources for configuring and organizing your project and for tracing variable values:

2.3.11Libraries

You can include in your project a series of libraries whose POUs, data types, and global variables you can use just like user-defined variables. The libraries standard.lib and util.lib are standard parts of the program and are always at your disposal.

See 'Library Manager'.

2.3.12Data types

Along with the standard data types the user can define his own data types. Structures, enumeration types and references can be created.

See chapter 'Data Types' of the Online Help chapters.

2.3.13Visualization

WAGO-I/O-PRO 32 provides visualizations so that you can display your project variables. You can plot geometric elements off-line with the help of the visualization. In Online mode, these can then change their form/color/text output in response to specified variable values.

See 'Visualization'.

2.4 Languages

2.4.1 Instruction List (IL)

An instruction list (IL) consists of a series of instructions. Each instruction begins in a new line and contains an operator and, depending on the type of operation, one or more operands separated by commas.

In front of an instruction there can be an identification mark (label) followed by a colon (:).

A comment must be the last element in a line. Empty lines can be inserted between instructions.

Example:

LD 17

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

22WAGO-I/O-PRO 32 V2.2 Overview

Languages

ST

lint (* comment *)

GE

5

JMPC

next

LD

idword

EQ

istruct.sdword

STN

test

next:

 

2.4.1.1 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.

Nwith 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:

 

Operator

Modifiers

Meaning

 

 

LD

N

Make current result equal to the operand

 

 

 

 

 

 

 

ST

N

Save current result at the position of the

 

 

 

 

operand

 

 

 

 

 

 

 

S

 

Then put the Boolean operand exactly at

 

 

 

 

TRUE if the current result is TRUE

 

 

 

 

 

 

 

R

 

Then put the Boolean operand exactly at

 

 

 

 

FALSE if the current result is TRUE

 

 

 

 

 

 

 

AND

N,(

Bitwise AND

 

 

 

 

 

 

 

OR

N,(

Bitwise OR

 

 

 

 

 

 

 

XOR

N,(

Bitwise exclusive OR

 

 

 

 

 

 

 

 

 

 

 

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32

 

 

 

WAGO-I/O-PRO 32 V2.2 Overview 23

 

 

 

Languages

 

 

 

 

 

 

 

 

 

 

 

Operator

Modifiers

Meaning

 

 

ADD

(

Addition

 

 

 

 

 

 

 

SUB

(

Subtraction

 

 

 

 

 

 

 

MUL

(

Multiplication

 

 

 

 

 

 

 

DIV

(

Division

 

 

 

 

 

 

 

GT

(

>

 

 

 

 

 

 

 

GE

(

>=

 

 

 

 

 

 

 

EQ

(

=

 

 

 

 

 

 

 

NE

(

<>

 

 

 

 

 

 

 

LE

(

<=

 

 

 

 

 

 

 

LT

(

<

 

 

 

 

 

 

 

JMP

CN

Jump to the label

 

 

 

 

 

 

 

CAL

CN

Call programor function block or

 

 

 

 

 

 

 

RET

CN

Leave POU and return to caller.

 

 

 

 

 

 

 

)

 

Evaluate deferred operation

 

 

 

 

 

 

You find a list of all IEC operators in the appendix.

Example of an IL program while using some modifiers:

LD

TRUE

(*load TRUE in the accumulator*)

ANDN

BOOL1

(*execute AND with the negated value of the

 

BOOL1 variable*)

JMPC

mark

(*if the result was TRUE, then jump to the

 

label "mark"*)

LDN

BOOL2 (*save the negated value of *)

ST

ERG

(*BOOL2 in ERG*)

label:

 

LD

BOOL2 (*save the value of *)

WAGO-I/O-SYSTEM 759 WAGO-I/O-PRO 32