Reference – Lenze PM94P01C User Manual
Page 100

PM94P01C
98
Reference
Table 53: ON FAULT/ENDFAULT
ON FAULT/
ENDFAULT
Defines Fault Handler
Statement
Purpose
This statement initiates the Fault Handler section of the User Program. The Fault Handler is a piece
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:
MOVE, MOVED, MOVEP,MOVEDR, MOVEPR, MDV, MOTION SUSPEND, MOTION RESUME,
GOTO, GOSUB, JUMP, ENABLE, WAIT and VELOCITY ON/OFF
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}
;Any 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 a ENDFAULT statement
Table 54: REGISTRATION ON
REGISTRATION ON Registration On
Statement
Purpose
This statement arms the registration input, (input IN_C3). When the registration input is activated,
the Flag Variable “F_REGISTRATION” is set and the current position is captured and stored
to the “RPOS” System Variable. Both of these variables are available to the User Program for
decision making purposes. 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 input is activated and then come back to the sensor position.
…{statements}
REGISTRATION ON
;Arm registration input
MOVE UNTIL F_REGISTRATION
;Move until input is activated, (sensor hit)
MOVEP RPOS
;Absolute move to the position of the sensor
…{statements}