![background image](http://html1.mh-extra.com/html/omron/sysmac-cj-series/sysmac-cj-series_operation-manual_743585222.webp)
All BASIC commands
Section 4-2
210
4-2-173 ON.. GOTO
/i
4-2-174 OP
/i
Type
Program control command
Syntax
ON expression GOTO label [,label[,...]]
Description
The expression is evaluated and then the integer part is used to select a
label from the list. If the expression has the value 1 then the first label is
used, 2 then the second label is used, and so on. If the value of the
expression is less than 1 or greater than the number of labels then an
error occurs. Once the label is selected, subroutine
GOTO
jump to that
label 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 GOTO mover,stopper,change
See also
N/A
Type
I/O 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
depends on the number of additional
digital I/O connected to the PLC and
value
is the value to be output,
either 0 or 1.
•
Command
OP(binary_pattern)
sets the binary pattern to the 24 out-
puts 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 oth-
ers which are not to be changed.
Note: The first 8 outputs (0 to 7) do not physically exist on the CJ1W-
MCH72. They can not be written to and will always return 0.
Arguments
•
output_number
The number of the output to be set. The range for this parameter
depends on the number of additional digital I/O connected to the
PLC. If there are no digital I/O connected, the range for this parame-
ter is 8..31
•
value
The value to be output, either OFF (0) or ON (1). All non-0 values
are considered as ON.
•
binary_pattern
The integer equivalent of the binary pattern is to be output.
Содержание SYSMAC CJ Series
Страница 2: ......
Страница 70: ...Specifications Section 2 4 58...
Страница 84: ...FINS commands Section 3 4 72...
Страница 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Страница 277: ...Section 265 SECTION 5 Examples This chapter gives 2 categories of examples and tips How to s Practical examples...
Страница 370: ...Section 358...