Omron trajexia CJ1W-MCH72 Operation Manual page 205

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

Advertisement

All BASIC commands
194
/i
Example
A machine must move to one of 3 positions depending on the selection
made by 2 switches. The options are home (if both switches are off),
position 1 (if the first switch is on and the second switch is off) and posi-
tion 2 (if the first switch is off and the second switch is on). Position 2
has priority over position 1.
'define absolute positions
home=1000
position_1=2000
position_2=3000
WHILE IN(run_switch)=ON
IF IN(6)=ON THEN 'switch 6 selects position 2
MOVEABS(position_2)
WAIT IDLE
ELSEIF IN(7)=ON THEN 'switch 7 selects position 1
MOVEABS(position_1)
WAIT IDLE
ELSE
MOVEABS(home)
WAIT IDLE
ENDIF
WEND
Example
An X-Y plotter has a pen carousel. The position of this carousel is fixed
relative to the absolute zero position of the plotter. To change pens, an
absolute move to the carousel position finds the target irrespective of
the plot position.
MOVEABS(28.5,350) ' move to just outside the pen holder area
WAIT IDLE
SPEED = pen_pickup_speed
MOVEABS(20.5,350) ' move in to pick up the pen
0,0
Section 4-2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents