Introduction – Lenze PM94P01C User Manual

Page 18

Advertising
background image

PM94P01C

16

Introduction

With Fault Handler

Add the following code to the end of your sample program. While the program is running, switch the ENABLE input
IN_A3, to the off state. This will cause the drive to generate an F_36 fault (Drive Disabled) and put the drive into a Fault
Mode. From this point the Fault Handler Routine will take over.

F_PROCESS:
WAIT UNTIL IN_A4==1 ;Wait until reset switch is made
WAIT UNTIL IN_A4==0 ;and then released before
GOTO RESET_DRIVE

;returning to the beginning of the program

END
;*********************** Sub-Routines **************************************
Enter Sub-Routines here;
;*********************** Fault Handler Routine *****************************
ON FAULT

;Statement starts fault handler routine

;Motion stopped, drive disabled, and events no longer

;scanned while executing the fault handler routine.

OUT2 = 0

;Output 1 off to Disengage gripper.

;This will drop the part in the gripper

OUT1 = 0

;Retract Pick arm to make sure it is up and out of the way

RESUME F_PROCESS

;program restarts from label F_PROCESS

ENDFAULT

;fault handler MUST end with this statement

NOTE

The following statements can not be used inside the Fault Handler Routine:

- ENABLE
- WAIT
- MOVE
- MOVED
- MOVEP
- MOVEDR
- MOVEPR
- MDV
- MOTION SUSPEND
- MOTION RESUME
- GOTO, GOSUB
- JUMP
- ENABLE
- VELOCITY ON/OFF

Refer to section 2.1 for additional details and the Language Reference section for the statement
“ON FAULT/ENDFAULT”.

Advertising