Specifications
Examples and tips
PROGRAMMING MANUAL 271
Revision 5.0
'Omron Auto Generated - Symbols End
'Omron Auto Generated - Local Variables
alarm_bit=0
i=0 'Servo Parameters
res=0 'Servo Parameters
res_act=0
res_ant=0
res_bit=0
run_act=0
run_ant=0
run_bit=0
stop_act=0
stop_ant=0
stop_bit=0
'Omron Auto Generated - Local Variables End
VR(signal_state) = 0
This subroutine tests whether the detected hardware is the expected
one or not. If the right hardware is detected, it sets the right values to
the axes and servo drives
At least the right system needs to be properly detected
'once
GOSUB system_detection
This subroutine stops all possible running programs and movements.
'Stop all potential programs movements
GOSUB stop_all
status_word=1
The main loop of the program handles the fault handling: run
application programs, stop application programs, reset the system and
report the status.
loop:
IF alarm_bit THEN
action=1 ' Alarm, push RESET to restart
IF status_word<>2 THEN
PRINT "Stop with Alarm"
GOSUB stop_all
status_word=2 'Programs stopped with error
ENDIF
IF res_bit=1 THEN
action=2 'Resetting
PRINT "Resetting"
GOSUB reset_all
status_word=1 'Programs stopped NO error
ENDIF
ELSE
action=3 'OK
IF run_bit=1 THEN
PRINT "Start application"
GOSUB start_app
status_word=3 'Application running
ENDIF
IF stop_bit=1 AND status_word=3 THEN
PRINT "Stop by command"
GOSUB stop_all
status_word=1
ENDIF
ENDIF