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)
Summary of Contents for SYSMAC CJ Series
Page 2: ......
Page 70: ...Specifications Section 2 4 58...
Page 84: ...FINS commands Section 3 4 72...
Page 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Page 370: ...Section 358...