Lenze PMSS1000 Simple Servo User Manual

Page 37

Advertising
background image

Indexer-Programmer-Manual.pdf REV 1.3

IF/ELSE Structure

The IF/ELSE statement is used to execute an statement or a block of statements one time if a condition is
true and a different statement or block of statements if condition is false.
The simplified syntax for the IF/ELSE statement is:


IF <condition>
…statement(s)
ELSE
…statement(s)
ENDIF

The following flowchart and code segment illustrate the use of the IF/ELSE instruction.

Start

Input1 ON?

Set Output 2 ON
Move Distance 3

inches

End

Yes

Set Output 2 OFF

Move Distance 5

inches

No

…statements

IF IN_A2
OUT2=1
MOVED

3

ELSE
OUT2=0
MOVED

5

ENDIF

..statements


WAIT Statement

The WAIT statement is used to suspend program execution until or while a
condition is true. The simplified syntax for this statement is:

WAIT UNTIL <condition>
WAIT WHILE

<condition>

WAIT TIME <time>
WAIT MOTION

COMPLETE


37

Advertising