Lenze PMSS1000 Simple Servo User Manual

Page 33

Advertising
background image

Indexer-Programmer-Manual.pdf REV 1.3

NOTE 1
Flag logic is shown below :
If
TPOS-INPOSLIM < APOS < TPOS+INPOSLIM && F_MCOMPLETE && F_MQUEUE_EMPTY

F_IN_POSITION = TRUE

Else
F_IN_POSITION = FALSE

End If

For VELOCITY and GEAR mode F_MCOMPLETE and F_MQUEUE_EMPTY flags are ignored and
assumed TRUE.

2.11 Control

Structures

Control structures allow you to control the flow of your program's execution. Most of the power and utility
of any programming language comes from its ability to change statement order with structure and loops.

DO/UNTIL structures

This statement is used to execute a block of code one time and then continue executing that block until a
condition becomes true (satisfied). The difference between DO/UNTIL and WHILE statements is that the
DO/UNTIL instruction tests the condition after the block is executed so the conditional statements are
always executed at least one time. The syntax for DO/UNTIL statement is:

DO

…statements

UNTIL <condition>


The following flowchart and code segment illustrate the use of the DO/UNTIL statement.

Start

Move DIstance 3

inches Delay 2

seconds

Is input 2 ON?

End

YES

NO

… statements

DO
MOVED

3

WAIT

TIME

2000

UNTIL IN_A3

…statements

33

Advertising