Omron trajexia CJ1W-MCH72 Operation Manual page 140

Sysmac cj-series programmable controller
Hide thumbs Also See for trajexia CJ1W-MCH72:
Table of Contents

Advertisement

All BASIC commands
/i
Example
A production line must stop if something blocks the product belt, which
causes a motion error. The obstacle must be removed, and a reset but-
ton must be pressed to restart the line.
FORWARD 'start production line
WHILE IN(2)=ON
IF MOTION_ERROR=0 THEN
OP(8,ON) 'green light on; line is in motion
ELSE
OP(8, OFF)
GOSUB error_correct
ENDIF
WEND
CANCEL
STOP
error_correct:
REPEAT
OP(10,ON)
WA(250)
OP(10,OFF) 'flash red light to show crash
WA(250)
UNTIL IN(1)=OFF
DATUM(0) 'reset axis status errors
SERVO=ON 'turn the servo back on
WDOG=ON 'turn on the watchdog
OP(9,ON) 'sound siren that line will restart
WA(1000)
OP(9,OFF)
FORWARD 'restart motion
RETURN
/i
Example
The position of an axis must be defined by the Z marker. This position
must be set to zero. Then the axis must move to this position. Using the
datum 1 the zero point is set on the Z mark. But the axis starts to decel-
erate at this point, and therefore it stops after the mark. A move is used
to bring it back to the Z position.
SERVO=ON
WDOG=ON
CREEP=1000 'set the search speed
SPEED=5000 'set the return speed
DATUM(1) 'register on Z mark and sets this to datum
WAIT IDLE
MOVEABS (0) 'moves to datum position
Section 4-2
129

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents