All BASIC commands
Section 4-2
108
/i
Example
A masked wheel is used to create a stencil for a laser to shine through
for use in a printing system for the ten numerical digits. The required
digits are transmitted through port 1 serial port to the controller as ASCII
text.
The encoder used has 4000 edges per revolution and so must move
400 between each position. The cam table goes from 0 to 1, which
means that the
CAM
multiplier needs to be a multiple of 400 to move
between the positions.
The wheel is required to move to the pre-set positions every 0.25 sec-
onds. The speed is set to 10000 edges/second, and we want the profile
to be complete in 0.25 seconds. So multiplying the axis speed by the
required completion time (10000 x 0.25) gives the distance parameter
equals 2500.
GOSUB profile_gen
WHILE IN(2)=ON
WAIT UNTIL KEY#1 'Waits for character on port 1
GET#1,k
IF k>47 AND k<58 THEN 'check for valid ASCII character
position=(k-48)*400 'convert to absolute position
multiplier=position-offset 'calculate relative movement
'check if it is shorter to move in reverse direction
IF multiplier>2000 THEN
multiplier=multiplier-4000
ELSEIF multiplier<-2000 THEN
multiplier=mul4000
ENDIF
CAM(0,200,multiplier,2500) 'set the CAM movment
WAIT IDLE
OP(15,ON) 'trigger the laser flash
WA(20)
OP(15,OFF)
offset=(k-48)*400 'calculates current absolute position
ENDIF
WEND
LASER
MOTOR
OP(15)
TRIGGER
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...