![background image](http://html1.mh-extra.com/html/omron/trajexia-cj1w-mch72/trajexia-cj1w-mch72_operation-manual_742454119.webp)
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
Содержание trajexia CJ1W-MCH72
Страница 69: ...Specifications Section 2 4 58...
Страница 83: ...FINS commands Section 3 4 72...
Страница 147: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...All BASIC commands Section 4 2 266...
Страница 278: ...267 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 371: ...360 Index...
Страница 373: ...362...