![background image](http://html1.mh-extra.com/html/omron/sysmac-cj-series/sysmac-cj-series_operation-manual_743585236.webp)
All BASIC commands
Section 4-2
224
4-2-194 READ_OP
/i
Type
I/O command
Syntax
READ_OP(output_no)
READ_OP(first_output_no, last_output_no)
Description
READ_OP(output_no)
, returns the binary value (0 or 1) of the digital
output
output_no
.
READ_OP(first_output_no, last_output_no)
, returns the number that
is the decimal representation of the concatenation of the binary values
of the range
first_output_no
to
final_output_no
.
Note: The difference between
first_output_no
and
last_output_no
must be less than 24.
Note: Outputs 0 to 7 do not physically exist on the CJ1W-MCH72. They
cannot be written. Their return value is always 0.
Note:
READ_OP
checks the state of the output logic.
READ_OP
can
return the value 1 even if no actual output is present.
Arguments
•
output_no
The number of the output.
•
first_output_no
The number of the first output of the output range.
•
last_output_no
The number of the last output of the output range.
Example
If output 11 has value 1, output 12 has value 1, output 13 has value 0,
and output 14 has value 1,
READ_OP(11,14)
returns 13 (1101 bin).
Example
In this example a single output is tested:
WAIT UNTIL READ_OP(12) = ON
GOSUB place
Example
Check a range of 8 outputs and call a routine if one of them has value 1:
op_bits = READ_OP(16, 23)
IF op_bits <> 0 THEN
GOSUB check_outputs
ENDIF
See also
N/A
Содержание 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...