Omron trajexia CJ1W-MCH72 Operation Manual page 221

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

Advertisement

All BASIC commands
4-2-174 ON
4-2-175 ON.. GOSUB
210
/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

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents