Lenze E94P v2.0 User Manual
Page 8

8
P940HBK01B
WAITENABLE:
WAIT UNTIL IN_A3
; wait until A3 - hardware “enable” closed
ENABLE
; enable/start drive (& brake if assigned)
WAIT TIME 1000
; wait 1 second to release brake
OUT2 = 1
; Release Brake
WAIT TIME 1000
; Wait 1 sec.
VAR_REFERENCE = 0
; external reference for speed control
OUT1 = 0
; clear “fault” outputs
V0 = 0
Again:
; Empty loop does nothing while the motor spins
GOTO Again
; execute motions in the loop
END
; shouldn’t get here anyway
;-------------------------------------------------------------------------------
;The Fault handling code below directs the code execution here when a fault
occurs
;-------------------------------------------------------------------------------
PROCESSFAULT:
V0 = DFAULTS
; do this so you can see that it was a fault
OUT1 = 1
; indicate fault on LED output too
IF DFAULTS == 36
; user switch disabled
IREF = 0
; set internal speed reference to zero
VAR_REFERENCE = 1 ; select Internal reference
WAIT TIME 1000
; Wait 1 sec. (for motor to stop)
OUT2 = 0
; engage Brake
DISABLE
; disable outputs (incl. brake if assigned)
GOTO START
; reinitialize and wait for user to enable
ENDIF
GOTO WAITENABLE
; continue program
;********************************* Fault Handling Code ************************
ON FAULT
RESUME PROCESSFAULT
ENDFAULT