![background image](http://html1.mh-extra.com/html/omron/r88a-mcw151-drt-e/r88a-mcw151-drt-e_operation-manual_742243181.webp)
166
Command, function and parameter description
Section 6-3
6-3-131 ON
Type:
Structural Command
Syntax:
ON
expression
GOSUB
label
{ ,
label
}
ON
expression
GOTO
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 then the second label is used, and so
on. Depending on the GOSUB or GOTO command the subroutine or normal
jump is performed.
Precautions:
If the expression is not valid, no jump is performed.
Arguments:
expression
Any valid BASIC expression.
label
Any valid label in the program.
See also:
GOSUB, GOTO
Example:
REPEAT
GET#5,char
UNTIL 1<=char and char<=3
ON char GOSUB mover, stopper, change
6-3-132 OP
Type:
I/O Function/Command
Syntax:
OP(
output_number
,
value
)
OP(
binary_pattern
)
OP
Description:
The OP command sets one or more outputs or returns the state of the first 24
outputs. OP has three different forms depending on the number of arguments.
• Command OP(output_number,value) sets a single output channel. The
range of
output_number
is between 8 and 17 and
value
is the value to be
output, either 0 or 1.
• Command OP(binary_pattern) sets the binary pattern to the 24 outputs
according to the value set by binary_pattern.
• Function OP (without arguments) returns the status of the first 24 outputs.
This allows multiple outputs to be set without corrupting others which are
not to be changed.
Refer to 3-3-2 Digital I/O for a description of the various types of output and
inputs.
Precautions:
The first 8 outputs (0 to 7) do not physically exist on the MC Unit. They can
not be written to and will always return 0.
Arguments:
output_number
The number of the output to be set.
value
The value to be output, either OFF or ON. All non-zero values are considered
as ON.
binary_pattern
The integer equivalent of the binary pattern is to be output.
See also:
IN
Examples:
Example 1
The following two lines are equivalent.