I/O Port #H

The module has 16 I / O port lines, which can be expanded to up to 125. If the port input pins are changed, macros can be started, see #MHP, and #MHB.


Port-Access (8 I/Os)

Define port (input/output)

(Hardware Port Control)

#HPC

Port, I/O, I/O [Port+1], ...

Set port output

(Hardware Port Write)

#HPW

Port, State, State [Port+1], ..

Read port inputs

(Hardware Port Read)

#HPR

Port (0), Number(2)

Send port information

(Hardware Port Information)

#HPI


Pin-Access

Define port-pin (input/output)

(Hardware Bit Control)

#HBC

Portpin, I/O, I/O [Port+1], ...

Set port-pin output

(Hardware Bit Write)

#HBW

Portpin, State, State [Port+1], ..

Read port-pin input

(Hardware Bit Read)

#HBR

Portpin(0), Number(16)


Port-Access (8 I/Os)

Define port (input/Ausgang)

#HPC

Port, I/O, I/O [Port+1], ...

The command defines the direction (I/O) of the individual port pins bit by bit for an entire Port [0 ... 15]:

I/O

0

Output

1

Input


Port 0


0

1

2

3

4

5

6

7

Input




Output






...

#HPC 0,$E9

...


...

#HPC 0,%11101001

...


Set port output

#HPW

Port, State, State [Port+1], .

The command sets the State of the outputs bit by bit for an entire Port.

State

0

Low

1

High


Port 0


0

1

2

3

4

5

6

7

State

...

#HPC 0,0

#HPW 0,$B4

...


...

#HPC 0,0

#HPW 0,%10110100

...


Read port inputs

#HPR

Port (0), Number(2)

The command puts the state of one or more (Number) of ports (starting with Port) in the send buffer. The feedback is structured as follows:

ESC

H

P

R

Port

Number

State 1

State 2

...


$1B

$48

$50

$52

8-Bit value

8-Bit value

8-Bit value

8-Bit value

...

#HPR 0,2

...


See also port(a)


Send port information

#HPI

Indicates which of the 16 possible port modules are connected (= 1) and places this information in the send buffer. The feedback is structured as follows:

ESC

H

P

I

Returnvalue (1 bit per  port)


$1B

$48

$50

$49

16-Bit value

...

#HPI

...

The port expander with address 0 is internally available, that means without external hardware the return value is 1.

Pin-Access

Define port-pin (input/output)

#HBC

Portpin, I/O, I/O [Port+1], ...

The command defines the direction (I/O) for the Portpin:

I/O

0

Output

1

Input


Set port-pin output

#HBW

Portpin, State, State [Port+1], ..

The command sets the State of the output for the Portpin.

State

0

Low

1

High

2

Invert


Read port-pin input

#HBR

Portpin(0), Number(16)

The command puts the state of one or more (Number) of port pins (starting with port pin) in the send buffer. The feedback is structured as follows:

ESC

H

B

R

Portpin

Number

State 1

State 2

...


$1B

$48

$42

$52

8-Bit value

8-Bit value

8-Bit value

8-Bit value

...

#HBR 0,4

...


See also bit(a)