3.2.7. GET BIT
Is used to command the module to read the value of 1 pin on a certain port.
Byte Count
Command
Parameter
Host Command
3
0x14
PORT
BIT
Module
Response
2
0x14
BITVALUE
1
0xEE
-
PORT parameter is the port code that will be accessed. 0 represents Analog
Input, 1 represents Digital I/O, and 2 represents General Purpose I/O.
BIT parameter are the bit numbers (0-7) that will be accessed.
BIT parameter VALUE are the the value of the bit (register PINx), cleared (0)
for low logic or set (1) for high logic.
If packet is recognized and correct, module will respond with data reading
result.
If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
: 0x58 0x03 0x14 0x00 0x02 0x8F
USB Smart I/O
: 0x58 0x02 0x14 0x00 0x92
means that the computer requests the value of bit 2 on Analog Input and
module replies that the logic on that bit is low.
3.2.8. SET BYTE
Is used to command the module to change the value of a certain port.
Byte Count
Command
Parameter
Host Command
3
0x15
PORT
BYTEVALUE
Module
Response
1
0xAA
-
0xEE
-
PORT parameter is the port code that will be accessed. 0 represents Analog
Input, 1 represents Digital I/O, and 2 represents General Purpose I/O.
BYTEVALUE parameter is the the value of the byte that will be sent to the port.
If packet is recognized and correct, module will respond with ACK (0xAA).
If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
: 0x58 0x03 0x15 0x00 0x55 0x3B
USB Smart I/O
: 0x58 0x01 0xAA 0xFD
will send a value of 0x55 to Analog Input.
3.2.9. GET BYTE
Is used to command the module to read the value of a certain port.
Byte Count
Command
Parameter
Host Command
2
0x16
PORT
Module Response
2
0x16
BYTEVALUE
1
0xEE
-
PORT parameter is the port code that will be accessed. 0 represents Analog
Input, 1 represents Digital I/O, and 2 represents General Purpose I/O.
BYTEVALUE parameter is the value of the port (register PINx).
11