If the packet is false/not recognized, module will respond with NACK (0xEE).
Example:
PC
: 0x58 0x02 0x11 0x02 0x93
USB Smart I/O
: 0x58 0x04 0x11 0x00 0x00 0x1F 0x74
means that the computer requests for General Purpose I/O function and
module replies that all General Purpose I/O are digital inputs with active
internal pull-up resistors.
3.2.5. GET PORT
Is used to command the module to read the value of a certain port.
Byte Count
Command
Parameter
Host Command
2
0x12
PORT
Module Response
2
0x12
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 PORTx).
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 0x02 0x12 0x01 0x93
USB Smart I/O
: 0x58 0x02 0x12 0x88 0x0C
means that the computer requests the value to Digital I/O and module replies
that the PORT value on that port is 0x88.
3.2.6. SET BIT
Is used to command the module to change the value of 1 pin on a certain port.
Byte Count Command
Parameter
Host
Command
4
0x13
PORT
BIT
BITVALUE
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.
BIT parameter are the bit numbers (0-7) that will be accessed.
BIT parameter VALUE are the values that will be sent to the bits. It is cleared
(0) to send low logic or set (1) to send high logic.
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 0x04 0x13 0x01 0x05 0x01 0x8A
USB Smart I/O
: 0x58 0x01 0xAA 0xFD
will send a value of 1/high to Digital I/O bit 5.
10