All BASIC commands
Section 4-2
209
/i
4-2-171 ON
/i
4-2-172 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
.
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...