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
Summary of Contents for SYSMAC CJ Series
Page 2: ......
Page 70: ...Specifications Section 2 4 58...
Page 84: ...FINS commands Section 3 4 72...
Page 148: ...All BASIC commands Section 4 2 136 AXIS 1 AXIS 0...
Page 370: ...Section 358...