Examples and tips
PROGRAMMING MANUAL
280
Revi
si
on 3.0
'=1 programs stopped but no error
'=2 programs stopped and error
'=3 programs running
project_status=0
'alarm_status
'=0 Nothing
'=1 Alarm in Axis 0
'=2 Alarm in Axis 1
'=3 Alarm in Axis 3
'=4 Alarm in MECHATROLINK
'=5 Healthy
alarm_status=5
'Action
'=0 Nothing
'=1 Push reset to restart
'=2 Resetting
'=3 OK
action=3
GOSUB stop_all
GOSUB start_application
loop:
'If Error or Stop command
IF MOTION_ERROR<>0 OR READ_BIT(1,0) THEN GOSUB alarm_sequence
'Clear the Servo Driver Warning if any
IF (DRIVE_STATUS AXIS(0) AND 2)>0 THEN DRIVE_CLEAR AXIS(0)
IF (DRIVE_STATUS AXIS(1) AND 2)>0 THEN DRIVE_CLEAR AXIS(1)
IF (DRIVE_STATUS AXIS(1) AND 2)>0 THEN DRIVE_CLEAR AXIS(1)
GOTO loop
alarm_sequence:
IF MOTION_ERROR<>0 THEN
project_status=2
action=1
'ERROR DIAGNOSTICS
'Checking for MECHATROLINK errors
I52E-EN-03.book Seite 280 Freitag, 29. Juni 2007 11:55 11