Reference – Lenze E94P PositionServo with MVOB User Manual

Page 100

Advertising
background image

98

L

PM94H201B_13xxxxxx_EN

Reference

Table 53: ON FAULT/ENDFAULT

ON FAULT/
ENDFAULT

Defines Fault Handler

Statement

Purpose

This statement defines the Fault Handler section of the User Program. The Fault Handler is a section
of code which is executed when a fault occurs in the drive. The Fault Handler program must begin
with the “ON FAULT” statement and end with the “ENDFAULT” statement. If a Fault Handler routine
is not defined, then the User Program will be terminated and the drive disabled upon the drive
detecting a fault. Subsequently, if a Fault Handler is defined and a fault is detected, the drive will be
disabled, all scanned events will be disabled, and the Fault Handler routine will be executed. The
RESUME statement can be used to redirect the program execution from the Fault Handler back to the
main program. If this statement is not utilized then the program will terminate once the ENDFAULT
statement is executed.

The following statements

can’t be used in fault handler:

DO / UNTIL, ENABLE, EVENT (ON, OFF), EVENTS (ON, OFF), GOTO, GOSUB, HALT, HOME,
JUMP, MDV, MOTION RESUME, MOTION SUSPEND, MOVE, MOVED, MOVEP, MOVEDR,
MOVEPR, STOP MOTION (QUICK), VELOCITY ON/OFF, WAIT and WHILE / ENDWHILE

Syntax

ON FAULT

{…statements}

ENDFAULT

See Also

RESUME

Example:

…{statements}

;User program

FaultRecovery:

;Recovery procedure

…{statements}

END
ON FAULT

;Once fault occurs program is directed here

…{statements}

;code to deal with fault

RESUME FaultRecovery

;Execution of RESUME ends Fault Handler and directs

;execution back to User Program.

ENDFAULT

;If RESUME is omitted the program will terminate here

Fault routine must end with an ENDFAULT statement

Table 54: REGISTRATION ON

REGISTRATION ON Registration On

Statement

Purpose

This statement arms the registration input (input IN_C3). When the registration is armed and the
registration input activated the Flag “F_REGISTRATION” is set and the current position is captured
and stored to the “RPOS” System Variable. The “REGISTRATION ON” statement, when executed will
reset the “F_REGISTRATION” flag ready for detection of the next registration input.

Syntax

REGISTRATION ON

Flag “F_REGISTRATION” is reset and
registration input is armed

See Also

MOVEDR, MOVEPR

Example:

; Moves until registration input is activated and then returns to the sensor position.
…{statements}
REGISTRATION ON

;Arm registration input

MOVE UNTIL F_REGISTRATION ;Move until registration flag is activated (triggered by

;registration input to C3), (sensor hit)

;Drive will decelerate to stop beyond Sensor position

MOVEP RPOS

;Absolute move back to the position of the sensor

…{statements}

Advertising