CHAPTER 2. USBOARD-USS5
2.6. COMMANDS
CMD_READ_PARASET
0
Bytes 1 to 6
CMD_READ_PARASET
1
Bytes 7 to 12
CMD_READ_PARASET
2
Bytes 13 to 18
CMD_READ_PARASET
3
Bytes 19 to 24
CMD_READ_PARASET
4
Bytes 25 to 30
CMD_READ_PARASET
5
Bytes 31 to 36
CMD_READ_PARASET
6
Bytes 37 to 42
CMD_READ_PARASET
7
Bytes 43 to 48
CMD_READ_PARASET
8
Bytes 49 to 54
2.6.8 CMD_GET_ANALOGIN
Use this command to acquire the data of the four analog inputs.
Command
ID:
+0
CMD_GET_ANALOGIN
0
0
0
0
0
0
0
Answer
ID:
+7
Because the resolution of the on-board AD-converter is 12 bit, the first part of the answer is made up of the four
low bytes. Bytes 5 and 6 contain the upper 4 bits of the four channels.
CMD_GET_ANALOGIN
low 8 bit
channel 0
low 8 bit
channel 1
low 8 bit
channel 2
low 8 bit
channel 3
high 4 bits of
channel 0 and 1
high 4 bits of
channel 3 and 4
0
2.6.9 CMD_GET_DATA
This command is used to request the readings of selected sensors. The selection is done by a bit mask where bit 0
stands for group 0, bit 1 stands for group 1 and so on. There will be one answer message per selected group.
Command
ID:
+0
CMD_GET_DATA
(selected groups)
0
0
0
0
0
0
Answer
ID:
+(13 + group_id)
CMD_GET_DATA
(info) lower
8
bit sensor
0
lower
8
bit sensor
1
lower
8
bit sensor
2
lower
8
bit sensor
3
high 4 bits of
sensors 0 and 1
high 4 bits of
sensors 3 and 4
The
info
byte contains
• 2 bits encoding the group id (0 to 3)
• 2 bits encoding the sensor resolution (0 for 1 cm, 1 for 0.5 cm, 2 for 0.25 cm, 3 for 0.125 cm)
• 4 bits denoting the sending sensor, either
0xFF
if all sensors are sending or the bit of the active sensor set
to 1 for cross echo mode
The
lower 8 bit
byte of a sensor can also contain an error code:
• 0 indicates that the sensor is not physically connected to the USBoard-USS5.
22