![background image](http://html1.mh-extra.com/html/omron/sysmac-cj-series/sysmac-cj-series_operation-manual_743585337.webp)
Practical examples
Section 5-2
325
alarm_sequence:
'Alarm notification
IF SYSTEM_ERROR=0 AND MOTION_ERROR=0 AND
READ_BIT(15,diag01)=1 THEN
alarm_bit=0
ELSE
IF MOTION_ERROR<>0 THEN
SET_BIT(0,status_bits) 'Motion error flag
first_error=ERROR_AXIS
ENDIF
alarm_bit=1
ENDIF
'MECHATROLINK axis alarm monitoring
FOR i=0 TO max_axis
BASE(i)
VR(servoi*2)=AXISSTATUS
'if stopped by alarm, notify the alarm code
IF ATYPE>=40 AND ATYPE<=42 THEN
IF status_word=2 THEN
'if no response, notify "communication alarm"
IF (AXISSTATUS AND 4)<>0 THEN
VR(servi*2)=$E6
ELSEIF NOT DRIVE_ALARM(servi*2) THEN
VR(servi*2)=$E6
ELSEIF VR(servi*2)=0 THEN
VR(servi*2)=$bb
ENDIF
'if no alarm, notify RUN=$99 or BaseBlock=$BB
ELSEIF(DRIVE_STATUS AND 8) THEN
VR(servi*2)=$99
ELSE
VR(servi*2)=$bb
ENDIF
ENDIF
NEXT i
sys_error=SYSTEM_ERROR
RETURN
'--------------------------------------------------------
stop_all:
'In this example, if the application program is stopped
'suddenly all the movements are cancelled and all the axes
'are set to BaseBlock. Modify this section if you require
'a different STOP procedure
STOP "APPLICATION"
WDOG=0
FOR i= 0 TO max_axis
BASE(i)
IF MARK=0 THEN REGIST(-1)
Содержание SYSMAC CJ Series
Страница 2: ......
Страница 70: ...Specifications Section 2 4 58...
Страница 84: ...FINS commands Section 3 4 72...
Страница 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...Section 265 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 370: ...Section 358...