Omron SYSMAC CJ Operation Manual page 337

Sysmac cj-series programmable controller motion control unit
Hide thumbs Also See for SYSMAC CJ:
Table of Contents

Advertisement

Practical examples
alarm_sequence:
'Alarm notification
IF
SYSTEM_ERROR=0
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(servo_status+i*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(servo_alarm+i*2)=$E6
ELSEIF NOT DRIVE_ALARM(servo_alarm+i*2) THEN
VR(servo_alarm+i*2)=$E6
ELSEIF VR(servo_alarm+i*2)=0 THEN
VR(servo_alarm+i*2)=$bb
ENDIF
'if no alarm, notify RUN=$99 or BaseBlock=$BB
ELSEIF(DRIVE_STATUS AND 8) THEN
VR(servo_alarm+i*2)=$99
ELSE
VR(servo_alarm+i*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)
AND
MOTION_ERROR=0
Section 5-2
AND
325

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cj1w-mch72

Table of Contents