All BASIC commands
Section 4-2
193
/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
AXIS 1
AXIS 0
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...