Data Sheet

Ether I/O 24R Users Manual V1.1
Elexol Pty Ltd Version 1.1 Page 21 http://www.elexol.com
ELEXOL
ELECTRONIC SOL UT IONS
Command Set (continued)
Write Port B Direction Register
ASCII Code Bytes Data Function
!B 3 Direction Writes data to ports direction register. Lines with a
corresponding bit value of 0 are set as outputs, lines with a bit
value of 1 are set as inputs
The power up default for Direction is 255 setting all lines as inputs
Operation: Same as Write Port A Direction Register
Example:
Winsock1.SendData “!B” + Chr$(Direction)
Write Port C Direction Register
ASCII Code Bytes Data Function
!C 3 Direction Writes data to ports direction register. Lines with a
corresponding bit value of 0 are set as outputs, lines with a bit
value of 1 are set as inputs
The power up default for Direction is 255 setting all lines as inputs
Operation: Same as Write Port A Direction Register
Example:
Winsock1.SendData “!C” + Chr$(Direction)
Write Port A Pull Up Register
ASCII Code Bytes Data Function
@A 3 Enable Writes data to port’s direction register. Lines with a
corresponding bit value of 0 have their pull up resistors turned
on, lines with a bit value of 1 have their pull up resistors turned
off
The power up default for Enable is 255; all pull up resistors turned off
Operation: This command affects all eight lines of port A whose direction is set as an input. The
Enable Value is written to the entire port with each of the bits in the byte affecting the
corresponding I/O line. To change a single I/O line’s behaviour without affecting the
others it is necessary to store the old value of the register or read its current value before
writing a new value with only the corresponding bits changed. To set the entire port with
pull up resistors turned on use Enable = 0 to turn all the pull up resistors off use Enable =
255 to set 0, 1, 2 and 3 as on and 4, 5, 6 and 7 as off use Enable = 240.
Example:
Winsock1.SendData “@A” + Chr$(Enable)
Write Port B Pull Up Register
ASCII Code Bytes Data Function
@B 3 Enable Writes data to port’s direction register. Lines with a
corresponding bit value of 0 have their pull up resistors turned
on, lines with a bit value of 1 have their pull up resistors turned
off
The power up default for Enable is 255; all pull up resistors turned off
Operation: Same as Write Port A Pull Up Register
Example:
Winsock1.SendData “@B” + Chr$(Enable)