Programming – Lenze E94P PositionServo with MVOB User Manual

Page 39

Advertising
background image

PM94H201B_13xxxxxx_EN

L

37

Programming

2.4.2 Boolean Operators

Table 9 lists the boolean operators supported by the Indexer program. Boolean operators are used in logical expressions.

Table 9: Supported Boolean Operators

Operator

Symbol

AND

&&

OR

||

NOT

!

Examples:
IF (APOS >2 && APOS <6) || (APOS >10 && APOS <20)

{statements if true}

ENDIF

The above example checks if APOS (actual position) is within one of two windows; 2 to 6 units or 10 to 20 units.
In other words:

If (APOS is more than 2 AND less than 6)
OR
If (APOS is more than 10 AND less then 20)
THEN the logical expression is evaluated to TRUE. Otherwise it is FALSE

2.5

Comparison Operators

Table 10 lists the comparison operators supported by the Indexer program.

Table 10: Supported Comparison Operators

Operator

Symbol

More

>

Less

<

Equal or more

>=

Equal or less

=<

Not Equal

<>

Equal

==

Examples:

IF APOS <=10

;If Actual Position equal or less than 10

IF APOS > 20

;If Actual Position greater than 20

IF V0==5

;If V0 equal to 5

IF V1<2 && V2 <>4 ;If V1 less than 2 And V2 doesn’t equal 4

2.6

System Variables and Flags

System variables are variables that have a predefined meaning. They give the programmer/user access to drive
parameters and functions. Some of these variables can also be set via the parameters in MotionView. In most cases
the value of these variables can be read and set in the user program or via a Host Interface. Variables are either read
only, write only or read and write. Read only variables can only be read and can’t be set. For example, INPUTS = 5, is
an illegal action because you can not set an input. Conversely, write-only variables cannot be read. Reading a write-only
variable by either the variable watch window or network communications can result in erroneous data.

System Flags are predefined bits that are used by a program either to remember something or to signal some condition.
Flags are binary values so contain only values 1 or 0 (True or False). For example, IN_A1 is the system flag that reflects
the state of digital input A1. Since inputs can only be ON or OFF, then the value of IN_A1 can only be 0 or 1.

Advertising