Examples and tips
PROGRAMMING MANUAL
282
Revi
si
on 3.0
reset_all:
WHILE MOTION_ERROR<>0
'Wait for rising edge in RESET input
WAIT UNTIL READ_BIT(2,0)=0
WAIT UNTIL READ_BIT(2,0)=1
action=2
'Reset faulty servos
FOR i=0 TO max_axis
BASE(i)
'In case of ML-II error the reset is:
IF (AXISSTATUS AND 4)<>0 THEN
MECHATROLINK(0,0)
WA(3000)
DATUM(0)
RUN "startup",1
STOP
ENDIF
'In case of Servo Driver error
IF (AXISSTATUS AND 8)<>0 THEN DRIVE_CLEAR
NEXT i
WA(100)
'In case of axis error
DATUM(0)
WEND
project_status=1 'Stopped but no error
alarm_status=5
action=3
RETURN
start_application:
'Wait for rising edge in bit 0 of VR(0)
WHILE READ_BIT(0,0)=0
IF MOTION_ERROR<>0 THEN RETURN
WEND
WHILE READ_BIT(0,0)=1
IF MOTION_ERROR<>0 THEN RETURN
WEND
RUN "APPLICATION"
project_status=3 'Application running
RETURN
I52E-EN-03.book Seite 282 Freitag, 29. Juni 2007 11:55 11