Omron trajexia CJ1W-MCH72 Operation Manual page 119

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

Advertisement

All BASIC commands
108
OP(15)
TRIGGER
/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=multiplier+4000
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
Section 4-2

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents