19
May ’00
Chapter 2. Commands
The following parameter (ASCII character) can either be:
I
to specify get the status of input ports, followed by:
port specifier
in the range of 0...4 (Table 4 lists the ports specified)
or
O
to specify that outputs are to be set, followed by
port specifier
in the range of 0...3 (Table 4 lists the ports specified)
logical operation in the range of 0...4 (Table 5 describes the logical operations)
port value
two ASCII characters (Table 6 shows the port values)
If neither I or O follows the H command, or if the port specifier and the values for the
logical operation are out of their range, carriage return and line feed are returned,
and no action is performed. Table 5 shows the assignment for the ports.
Table 6 shows the possible logical operations to write to an output. The port value is
either written directly to the output or the port status is read and a logical operation
is performed with the port value, the result of this operation is written back to the port.
Table 7 shows the value or status of the specified port.
Table 5: Port Specifier for H Command
Port Specifier
(ASCII Character)
Description
0
Open Collector Outputs
1
I/O Port 0...7
2
I/O Port 0...3
3
I/O Port 4...7
4
IN 0/1
Table 6: Logical Operation for H Command
Logical Operation
(ASCII Character)
Description
0
Port value is written directly to the output
1
Read status ANDed with port value
2
Read status ORed with port value
3
Read status XORed with port value
4
Read status is inverted (the port value is in
this case meaningless)
Table 7: Port Value
Status or Port Value
Description
00 to 03
Open Collector Outputs
00 to FF
I/O Port 0 to 7
00 to 0F
I/O Port 0 to 3
00 to 0F
Port 4 to 7
00 to 03 (only status)
IN 0/1