Reference – Lenze PM94P01C User Manual

Page 88

Advertising
background image

PM94P01C

86

Reference

Table 28: DO UNTIL

DO UNTIL

Do/Until

Statement

Purpose

The DO / UNTIL statement is used to execute a statement or set of statements repeatedly until a
logical condition becomes true. The Do / Until statements enclose the program code to be repeatedly
executed with the UNTIL statement containing the logical statement for exit of the loop.

Syntax

DO
{statement(s)}…
UNTIL <condition>
{statement(s)} any valid statement(s)
<condition> The condition to be tested.

Remarks

The loop statement or statements contained within a DO / UNTIL loop will always be executed at least
once because the logical condition to be tested is contained within the UNTIL statement in the last
statement of the loop.

See Also

WHILE, IF

Example:

V0 = 0

; Set V0 to Value 0

; Create Loop to perform Move command 12 times

DO

; Start of Do Loop

V0 = V0 + 1

; Add 1 to Variable V0

Moved 5

; Move (incremental) distance 5

Until V0 == 12

; Loop back to DO Statement, Repeat Until Logic True

Table 29: ENABLE

ENABLE

Enables the drive

Statement

Purpose

Enable turns on power to the motor. Drive shows ‘Run’ on display when in the enabled state.

Syntax

ENABLE

Remarks

Once a drive is enabled motion can be commanded from the user program. Commanding motion
while the drive is disabled will result in fault trip (F_27).

See Also

DISABLE

Example:

If Start_Button == 0

; If input B1 is off

Disable

; Disable Servo

Else

; Otherwise

Enable

; Enable Servo

MoveD 10

; Move (increment) Distance 10

Endif

Table 30: END

END

END program

Statement

Purpose

This statement is used to terminate (finish) user program and its events.

Syntax

END

Remarks

END can be used anywhere in program

See Also

DISABLE

Example:

END

;end user program

Advertising