![background image](http://html1.mh-extra.com/html/omron/trajexia-cj1w-mch72/trajexia-cj1w-mch72_operation-manual_742454221.webp)
All BASIC commands
Section 4-2
210
/i
4-2-174 ON
/i
4-2-175 ON.. GOSUB
/i
Example
A conveyor transports boxes. Labels must be applied onto these boxes.
The
REGIST
function can capture the position at which the leading
edge of the box is seen. Then, the
OFFPOS
command can adjust the
measured position of the axis to make it 0 at that point. Thus, after the
registration event has occurred, the measured position (seen in
MPOS
)
reflects the absolute distance from the start of the box. The mechanism
that applies the label can take advantage of the absolute position start
mode of the
MOVELINK
or
CAMBOX
commands to apply the label.
BASE(conv)
REGIST(3)
WAIT UNTIL MARK
OFFPOS = -REG_POS ' Leading edge of box is now zero
See also
AXIS
,
DEFPOS
,
DPOS
,
MPOS
,
UNITS
.
Type
Constant (read-only)
Syntax
ON
Description
The
ON
constant returns the numerical value 1.
Arguments
N/A
Example
OP (lever,ON)
The above line sets the output named lever to
ON
.
See also
N/A
Type
Program control command
Syntax
ON expression GOSUB label [,label[,...]]
Description
The
ON..GOSUB
and
ON..GOTO
structures enable a conditional jump.
The integer expression is used to select a label from the list. If the
expression has value 1 the first label is used, for value 2 the second
label is used, and so on. Once the label is selected, subroutine
GOSUB
jump to that label is performed.
Note: If the expression is not valid e.g. the result of the expression is
less than 1 or greater that the number of available labels in the program,
no jump is performed.
Arguments
•
expression
Any valid BASIC expression.
•
label
Any valid label in the program.
Example
REPEAT
GET#5,char
UNTIL 1<=char and char<=3
ON char GOSUB mover, stopper, change
See also
GOSUB..RETURN
,
GOTO
.
Содержание 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...