Omron SYSMAC CJ Operation Manual page 221

Sysmac cj-series programmable controller motion control unit
Hide thumbs Also See for SYSMAC CJ:
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cj1w-mch72

Table of Contents