3.103
EDH0162En1040 – 06/99
MM4005
RB — Read I/O input
Usage
IMM
PGM
MIP
Syntax
xxRB
Parameters
Description
xx
[int]
— I/O bit number.
Range
xx
—
0
to
8.
Units
xx
— None.
Defaults
xx
Missing: 0.
Out of range: Error E.
Floating point: Error A.
Description
This command reads the I/O input port. If
xx
is specified between 1 and 8,
the return is either 0 or 1, depending on the state of the selected I/O bit.
If the bit specifier
xx
is missing or set to 0, the controller returns the values
for all 8 bits. The return is a decimal number in ASCII format representing
the I/O byte. To find the values of each bit, the number must be converted
to binary.
NOTE
For the hardware definition of the I/O port, please see Appendix B,
Connector Pinouts, GPIO Connector.
Returns
xxRBnn, 0RBnn
1
,
or
RBnn
2
xx
—
I/O bit number.
nn
—
I/O bit value, 0 or 1.
nn
1
, nn
2
—
I/O byte value, 0 to 255 in ASCII format.
Errors
A
—
Unknown message code.
E
—
Incorrect I/O channel number.
S
—
Communication time-out.
Rel. Commands
RA
—
Read analog input.
Example
0RB
|
Read all 8 bits of the I/O input port.
RB209
|
Controller returns a value of 209, which converted to binary gives us
the following I/O input port status:
bit 8
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
1
1
0
1
0
0
0
1
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
Содержание MM4005
Страница 360: ...Section 7 Servo Tuning Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 368: ...Section 8 Appendices Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 405: ...EDH0162En1040 06 99 8 36 Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...
Страница 406: ...Section 9 Index Artisan Technology Group Quality Instrumentation Guaranteed 888 88 SOURCE www artisantg com ...