Difference between revisions of "Robotino3 IO protocol"
(→Tag) |
(→Commands) |
||
Line 177: | Line 177: | ||
|} | |} | ||
+ | ====SW_VERSION==== | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 190: | Line 191: | ||
|Response to GET_SW_VERSION | |Response to GET_SW_VERSION | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_DISTANCE_SENSOR_READINGS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_DISTANCE_SENSOR_READINGS | |GET_DISTANCE_SENSOR_READINGS | ||
Line 196: | Line 207: | ||
|Requesting the readings of all infrared distance sensors | |Requesting the readings of all infrared distance sensors | ||
|PC->MC | |PC->MC | ||
+ | |- | ||
+ | } | ||
+ | |||
+ | ====DISTANCE_SENSOR_READINGS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|DISTANCE_SENSOR_READINGS | |DISTANCE_SENSOR_READINGS | ||
Line 205: | Line 227: | ||
!Description | !Description | ||
|- | |- | ||
− | |0- | + | |0-3 |
− | | | + | |float32 |
− | | | + | |ADC reading in Volts of distance sensor 0 |
|- | |- | ||
|colspan="3"| | |colspan="3"| | ||
... | ... | ||
|- | |- | ||
− | | | + | |32-35 |
− | | | + | |float32 |
− | | | + | |ADC reading in Volts of distance sensor 8 |
|} | |} | ||
− | |Response to GET_DISTANCE_SENSOR_READINGS | + | |Response to GET_DISTANCE_SENSOR_READINGS. |
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====SET_MOTOR_SPEED==== | ||
+ | {| class="wikitable" | ||
|- | |- | ||
− | + | !Name | |
− | + | !Value | |
− | + | !Command data | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ! | ||
− | ! | ||
!Description | !Description | ||
− | + | !Direction | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|SET_MOTOR_SPEED | |SET_MOTOR_SPEED | ||
Line 262: | Line 269: | ||
|Set the speed set-point for one motor | |Set the speed set-point for one motor | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====GET_ALL_MOTOR_SPEEDS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_ALL_MOTOR_SPEEDS | |GET_ALL_MOTOR_SPEEDS | ||
Line 268: | Line 285: | ||
|Requesting the speed of all motors | |Requesting the speed of all motors | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====ALL_MOTOR_SPEEDS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ALL_MOTOR_SPEEDS | |ALL_MOTOR_SPEEDS | ||
Line 290: | Line 317: | ||
|Response to GET_ALL_MOTOR_SPEEDS. | |Response to GET_ALL_MOTOR_SPEEDS. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====SET_MOTOR_POSITION==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_MOTOR_POSITION | |SET_MOTOR_POSITION | ||
Line 309: | Line 346: | ||
|Set the position counter of one motor | |Set the position counter of one motor | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====GET_ALL_MOTOR_POSITIONS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_ALL_MOTOR_POSITIONS | |GET_ALL_MOTOR_POSITIONS | ||
Line 337: | Line 384: | ||
|Response to GET_ALL_MOTOR_POSITIONS. | |Response to GET_ALL_MOTOR_POSITIONS. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====SET_MOTOR_PID_PARAMETERS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_MOTOR_PID_PARAMETERS | |SET_MOTOR_PID_PARAMETERS | ||
Line 364: | Line 421: | ||
|Set PID parameters of one motor. | |Set PID parameters of one motor. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====GET_ALL_MOTOR_PID_PARAMETERS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_ALL_MOTOR_PID_PARAMETERS | |GET_ALL_MOTOR_PID_PARAMETERS | ||
Line 370: | Line 437: | ||
|Requesting the PID controller parameters of all motors | |Requesting the PID controller parameters of all motors | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====ALL_MOTOR_PID_PARAMETERS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ALL_MOTOR_PID_PARAMETERS | |ALL_MOTOR_PID_PARAMETERS | ||
Line 408: | Line 485: | ||
|Response to GET_ALL_MOTOR_PID_PARAMETERS. | |Response to GET_ALL_MOTOR_PID_PARAMETERS. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====SET_ALL_DIGITAL_OUTPUTS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_ALL_DIGITAL_OUTPUTS | |SET_ALL_DIGITAL_OUTPUTS | ||
Line 423: | Line 510: | ||
|Set digital output ports at Robotino's IO connector. | |Set digital output ports at Robotino's IO connector. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_ALL_RELAYS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_ALL_RELAYS | |SET_ALL_RELAYS | ||
Line 439: | Line 536: | ||
|Set the relays at Robotino's IO connector. | |Set the relays at Robotino's IO connector. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_ODOMETRY==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_ODOMETRY | |SET_ODOMETRY | ||
Line 462: | Line 569: | ||
|Set the odometry to the given pose | |Set the odometry to the given pose | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_ODOMETRY_ROTATION==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_ODOMETRY_ROTATION | |SET_ODOMETRY_ROTATION | ||
Line 477: | Line 594: | ||
|Set the odometry to the given rotation. Used when a gyroscope is connected to the PC to forward the gyroscope readings to the MC where the odometry is processed. | |Set the odometry to the given rotation. Used when a gyroscope is connected to the PC to forward the gyroscope readings to the MC where the odometry is processed. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====GET_ODOMETRY==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_ODOMETRY | |GET_ODOMETRY | ||
Line 483: | Line 610: | ||
|Request odometry readings from the MC | |Request odometry readings from the MC | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====ODOMETRY==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ODOMETRY | |ODOMETRY | ||
Line 506: | Line 643: | ||
|Response to GET_ODOMETRY | |Response to GET_ODOMETRY | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_ALL_MOTOR_CURRENT_READINGS==== | ||
+ | {| class="wikitable" | ||
|- | |- | ||
− | + | !Name | |
− | + | !Value | |
− | + | !Command data | |
− | + | !Description | |
− | + | !Direction | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|GET_ALL_MOTOR_CURRENT_READINGS | |GET_ALL_MOTOR_CURRENT_READINGS | ||
Line 524: | Line 659: | ||
|Request current readings from all motors | |Request current readings from all motors | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====ALL_MOTOR_CURRENT_READINGS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ALL_MOTOR_CURRENT_READINGS | |ALL_MOTOR_CURRENT_READINGS | ||
Line 533: | Line 678: | ||
!Description | !Description | ||
|- | |- | ||
− | |0- | + | |0-3 |
− | | | + | |float32 |
− | | | + | |Current in Ampere drawn from motor 0 |
|- | |- | ||
|colspan="3"| | |colspan="3"| | ||
... | ... | ||
|- | |- | ||
− | | | + | |12-15 |
− | | | + | |float32 |
− | | | + | |Current in Ampere drawn from motor 3 |
|} | |} | ||
|Response to GET_ALL_MOTOR_CURRENT_READINGS. | |Response to GET_ALL_MOTOR_CURRENT_READINGS. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_ALL_ANALOG_INPUTS==== | ||
+ | {| class="wikitable" | ||
|- | |- | ||
− | + | !Name | |
− | + | !Value | |
− | + | !Command data | |
− | + | !Description | |
− | + | !Direction | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
|GET_ALL_ANALOG_INPUTS | |GET_ALL_ANALOG_INPUTS | ||
Line 576: | Line 707: | ||
|Request all analog input readings. | |Request all analog input readings. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====ALL_ANALOG_INPUTS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ALL_ANALOG_INPUTS | |ALL_ANALOG_INPUTS | ||
Line 585: | Line 726: | ||
!Description | !Description | ||
|- | |- | ||
− | |0- | + | |0-3 |
− | | | + | |float32 |
− | |ADC readings from analog input port | + | |ADC readings in Volts from analog input port 1 |
|- | |- | ||
|colspan="3"| | |colspan="3"| | ||
... | ... | ||
|- | |- | ||
− | | | + | |32-35 |
− | | | + | |float32 |
− | |ADC readings from analog input port 8 | + | |ADC readings in Volts from analog input port 8 |
|} | |} | ||
|Response to GET_ALL_ANALOG_INPUTS. Readings of all analog input ports. | |Response to GET_ALL_ANALOG_INPUTS. Readings of all analog input ports. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_ALL_DIGITAL_INPUTS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_ALL_DIGITAL_INPUTS | |GET_ALL_DIGITAL_INPUTS | ||
Line 604: | Line 755: | ||
|Request all digital input readings. | |Request all digital input readings. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====ALL_DIGITAL_INPUTS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ALL_DIGITAL_INPUTS | |ALL_DIGITAL_INPUTS | ||
Line 610: | Line 771: | ||
|Response to GET_ALL_DIGITAL_INPUTS. Readings of all digital input ports. | |Response to GET_ALL_DIGITAL_INPUTS. Readings of all digital input ports. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_BUMPER==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_BUMPER | |GET_BUMPER | ||
Line 616: | Line 787: | ||
|Request all digital input readings. | |Request all digital input readings. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====BUMPER==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|BUMPER | |BUMPER | ||
Line 622: | Line 803: | ||
|Response to GET_BUMPER. The bumpers state. | |Response to GET_BUMPER. The bumpers state. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_POWER_BUTTON==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_POWER_BUTTON | |GET_POWER_BUTTON | ||
Line 628: | Line 819: | ||
|Request all digital input readings. | |Request all digital input readings. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====POWER_BUTTON==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|POWER_BUTTON | |POWER_BUTTON | ||
Line 634: | Line 835: | ||
|Response to GET_POWER_BUTTON. The power button state. | |Response to GET_POWER_BUTTON. The power button state. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====SET_FPGA_POWER==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_FPGA_POWER | |SET_FPGA_POWER | ||
Line 640: | Line 851: | ||
|Set the FPGA to hold the power supply | |Set the FPGA to hold the power supply | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====GET_FPGA_POWER==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_FPGA_POWER | |GET_FPGA_POWER | ||
Line 646: | Line 867: | ||
|Get the FPGA power supply hold status | |Get the FPGA power supply hold status | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====FPGA_POWER==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|FPGA_POWER | |FPGA_POWER | ||
Line 652: | Line 883: | ||
|Response to SET_FPGA_POWER and GET_FPGA_POWER. The FPGA power supply hold status. | |Response to SET_FPGA_POWER and GET_FPGA_POWER. The FPGA power supply hold status. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_PWR_OK_STATE==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_PWR_OK_STATE | |GET_PWR_OK_STATE | ||
Line 658: | Line 899: | ||
|Request status of the PWR_OK line. | |Request status of the PWR_OK line. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====PWR_OK_STATE==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|PWR_OK_STATE | |PWR_OK_STATE | ||
Line 667: | Line 918: | ||
operation. | operation. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====SET_PWR_OK_STATE==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_PWR_OK_STATE | |SET_PWR_OK_STATE | ||
Line 673: | Line 934: | ||
|Set the PWR_OK line. | |Set the PWR_OK line. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_PWM==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_PWM | |SET_PWM | ||
Line 692: | Line 963: | ||
|Set the PWM ratio of a single PWM output. | |Set the PWM ratio of a single PWM output. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_MOTOR_ON==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_MOTOR_ON | |SET_MOTOR_ON | ||
Line 711: | Line 992: | ||
|Enable/Disable a single motor. | |Enable/Disable a single motor. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_PWRBTN==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_PWRBTN | |SET_PWRBTN | ||
Line 719: | Line 1,010: | ||
triggered on the falling edge. | triggered on the falling edge. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_SYS_RESET==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_SYS_RESET | |SET_SYS_RESET | ||
Line 727: | Line 1,028: | ||
the system module in hardware reset. | the system module in hardware reset. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====GET_COM_EXPRESS_STATES==== | ||
+ | {| class="wikitable" | ||
|- | |- | ||
− | | | + | !Name |
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
+ | |- | ||
+ | |GET_COM_EXPRESS_STATES | ||
|50 | |50 | ||
|none | |none | ||
− | |Request status of the | + | |Request status of the COM Express status lines. |
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====aaaaa==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
− | | | + | |COM_EXPRESS_STATES |
|51 | |51 | ||
| | | | ||
Line 763: | Line 1,084: | ||
situation. This signal can be used to initiate thermal | situation. This signal can be used to initiate thermal | ||
throttling. | throttling. | ||
+ | |- | ||
+ | |4 | ||
+ | |uint8 | ||
+ | |THRMTRIP# | ||
|} | |} | ||
− | |Response to | + | |Response to GET_COM_EXPRESS_STATES. |
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_ALL_MOTOR_READINGS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_ALL_MOTOR_READINGS | |GET_ALL_MOTOR_READINGS | ||
Line 772: | Line 1,107: | ||
|Request speeds, positions, currents from all motors. | |Request speeds, positions, currents from all motors. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====ALL_MOTOR_READINGS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ALL_MOTOR_READINGS | |ALL_MOTOR_READINGS | ||
Line 803: | Line 1,148: | ||
|position of motor 4. | |position of motor 4. | ||
|- | |- | ||
− | |24- | + | |24-27 |
− | | | + | |float32 |
− | | | + | |Current in Ampere drawn from motor 1. |
|- | |- | ||
|colspan="3"| | |colspan="3"| | ||
... | ... | ||
|- | |- | ||
− | | | + | |36-39 |
− | | | + | |float32 |
− | | | + | |Current in Ampere drawn from motor 4. |
|} | |} | ||
|Response to GET_ALL_MOTOR_READINGS. | |Response to GET_ALL_MOTOR_READINGS. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====GET_IP_ADDRESS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|GET_IP_ADDRESS | |GET_IP_ADDRESS | ||
Line 822: | Line 1,177: | ||
|Request IP4 address. | |Request IP4 address. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====IP_ADDRESS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|IP_ADDRESS | |IP_ADDRESS | ||
Line 841: | Line 1,206: | ||
|Response to GET_IP_ADDRESS. | |Response to GET_IP_ADDRESS. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====SET_IP_ADDRESS==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_IP_ADDRESS | |SET_IP_ADDRESS | ||
Line 860: | Line 1,235: | ||
|Set IP4 address. | |Set IP4 address. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | ====SET_EMERGENCY_BUMPER==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_EMERGENCY_BUMPER | |SET_EMERGENCY_BUMPER | ||
Line 866: | Line 1,251: | ||
|1 enables the emergency bumper feature. 0 disables it. If enabled all motors are stopped for 2s if the Robotino's bumper is hit. | |1 enables the emergency bumper feature. 0 disables it. If enabled all motors are stopped for 2s if the Robotino's bumper is hit. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | |||
+ | ====SET_MOTOR_MODE==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|SET_MOTOR_MODE | |SET_MOTOR_MODE | ||
Line 888: | Line 1,284: | ||
|Set the control mode of one motor. | |Set the control mode of one motor. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | |||
+ | ====RESET_LPC==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|RESET_LPC | |RESET_LPC | ||
Line 905: | Line 1,312: | ||
|Reset the LPC2378 microcontroller. | |Reset the LPC2378 microcontroller. | ||
|PC->MC | |PC->MC | ||
+ | |} | ||
+ | |||
+ | |||
+ | ====INFO==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|INFO | |INFO | ||
Line 911: | Line 1,329: | ||
|Transmitted to inform about some event. | |Transmitted to inform about some event. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | ====WARNING==== | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|WARNING | |WARNING | ||
Line 917: | Line 1,345: | ||
|Transmitted in case of a warning. | |Transmitted in case of a warning. | ||
|MC->PC | |MC->PC | ||
+ | |} | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | !Name | ||
+ | !Value | ||
+ | !Command data | ||
+ | !Description | ||
+ | !Direction | ||
|- | |- | ||
|ERROR | |ERROR | ||
Line 960: | Line 1,397: | ||
|Signed int. Serialization is little endian. | |Signed int. Serialization is little endian. | ||
|- | |- | ||
− | | | + | |float32 |
|4 | |4 | ||
|Floating point number single precision. Serialization is little endian. | |Floating point number single precision. Serialization is little endian. |
Revision as of 11:04, 16 November 2012
Contents
- 1 Description of the data exchange protocol between LPC2378 and COM-Express module over USB
- 1.1 Package assembly
- 1.2 Data escaping
- 1.3 Commands
- 1.3.1 GET_HW_VERSION
- 1.3.2 HW_VERSION
- 1.3.3 GET_SW_VERSION
- 1.3.4 SW_VERSION
- 1.3.5 GET_DISTANCE_SENSOR_READINGS
- 1.3.6 DISTANCE_SENSOR_READINGS
- 1.3.7 SET_MOTOR_SPEED
- 1.3.8 GET_ALL_MOTOR_SPEEDS
- 1.3.9 ALL_MOTOR_SPEEDS
- 1.3.10 SET_MOTOR_POSITION
- 1.3.11 GET_ALL_MOTOR_POSITIONS
- 1.3.12 SET_MOTOR_PID_PARAMETERS
- 1.3.13 GET_ALL_MOTOR_PID_PARAMETERS
- 1.3.14 ALL_MOTOR_PID_PARAMETERS
- 1.3.15 SET_ALL_DIGITAL_OUTPUTS
- 1.3.16 SET_ALL_RELAYS
- 1.3.17 SET_ODOMETRY
- 1.3.18 SET_ODOMETRY_ROTATION
- 1.3.19 GET_ODOMETRY
- 1.3.20 ODOMETRY
- 1.3.21 GET_ALL_MOTOR_CURRENT_READINGS
- 1.3.22 ALL_MOTOR_CURRENT_READINGS
- 1.3.23 GET_ALL_ANALOG_INPUTS
- 1.3.24 ALL_ANALOG_INPUTS
- 1.3.25 GET_ALL_DIGITAL_INPUTS
- 1.3.26 ALL_DIGITAL_INPUTS
- 1.3.27 GET_BUMPER
- 1.3.28 BUMPER
- 1.3.29 GET_POWER_BUTTON
- 1.3.30 POWER_BUTTON
- 1.3.31 SET_FPGA_POWER
- 1.3.32 GET_FPGA_POWER
- 1.3.33 FPGA_POWER
- 1.3.34 GET_PWR_OK_STATE
- 1.3.35 PWR_OK_STATE
- 1.3.36 SET_PWR_OK_STATE
- 1.3.37 SET_PWM
- 1.3.38 SET_MOTOR_ON
- 1.3.39 SET_PWRBTN
- 1.3.40 SET_SYS_RESET
- 1.3.41 GET_COM_EXPRESS_STATES
- 1.3.42 aaaaa
- 1.3.43 GET_ALL_MOTOR_READINGS
- 1.3.44 ALL_MOTOR_READINGS
- 1.3.45 GET_IP_ADDRESS
- 1.3.46 IP_ADDRESS
- 1.3.47 SET_IP_ADDRESS
- 1.3.48 SET_EMERGENCY_BUMPER
- 1.3.49 SET_MOTOR_MODE
- 1.3.50 RESET_LPC
- 1.3.51 INFO
- 1.3.52 WARNING
- 1.3.53 Data types
- 2 Communication example
Description of the data exchange protocol between LPC2378 and COM-Express module over USB
Most of the I/Os comming with Robotino 3 are still connected to a NXP LPC2378 microcontroller (MC). In contrast to previous versions of Robotino the interface between the MC and Robotino's internal industral PC is no longer RS232 but USB. This page describes the protocol used for communication between MC and PC over USB.
Package assembly
All data send from PC to MC and vice versa has the form
Field name | Bytes | Description |
---|---|---|
Head | 1 | Start of package |
Length | 2 | Length of package payload |
Payload | Payload data | |
Checksum | 2 | Calculated from length and payload bytes |
Head
The package header is the unique byte 0xAA.
Length
The number of bytes of the (not escaped) payload data.
package[1] = length & 0xFF; package[2] = 0xFF & ( length >> 8 );
Payload
The package payload data. The payload is composed of one or more commands. The payload send to the LPC2378 must not be larger than 128 bytes.
Checksum
Complement 2 of the sum of Length and Payload bytes before escaping.
uint16 calculate_checksum( const uint8* data, int dataSize ) { uint16 out = 0; for( int i=0; i<dataSize; ++i ) { out += *p; ++data; } return 0xffff & ( (1<<16) - out ); }
Data escaping
The Head byte 0xAA must be unique through out all data send. By this the receiver knows that whenever it reads 0xAA that a new package begins. This is achieved by going through all the Length, Payload and Checksum bytes and whenever 0xAA or the escape byte 0x55 is found this byte is prefixed with 0x55 and the byte is xored with 0x20.
uint8* data; //the complete package data (Head, Length, Payload, Checksum) uint8* escapedData; //buffer big enough to hold the escaped package data for( int i=1; i<numBytesInData; ++i ) //not that we are starting at 1, we do not escape the Head { if( 0xAA == *data || 0x55 == *data ) { *(escapedData+++) = 0x55; *(escapedData++) = ( *data ^ 0x20 ); } else { *(escapedData++) = *data; } ++data; }
When reading an escaped package look for the escape byte 0x55. When you found 0x55 in the stream read the next byte and xor it with 0x20 to get the unescaped value.
QByteArray read( int length ) const { QByteArray ba( length, 0 ); int i=0; while( i<length ) { char ch = 0; if( 1 != _serial->read( (unsigned char*)&ch, 1 ) ) { throw ParserException( "Error reading 1 byte" ); } if( 0x55 == ch ) { if( 1 != _serial->read( (unsigned char*)&ch, 1 ) ) { throw ParserException( "Error reading 1 byte" ); } ba[i] = ( ch ^ 0x20 ); } else if( 0xAA == ch ) { throw ParserException( "Found HEAD" ); } else { ba[i] = ch; } ++i; } return ba; }
Commands
Field name | Bytes | Description |
---|---|---|
Tag | 1 | The command tag |
Length | 1 | Number of bytes of command data |
Data | The command data. If Length=0 there is no Data field at all. |
GET_HW_VERSION
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_HW_VERSION | 1 | none | Requesting the hardware version | PC->MC |
HW_VERSION
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
HW_VERSION | 2 | String | Response to GET_HW_VERSION | MC->PC |
GET_SW_VERSION
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_SW_VERSION | 3 | none | Requesting the software version | PC->MC |
SW_VERSION
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
SW_VERSION | 4 | String | Response to GET_SW_VERSION | MC->PC |
GET_DISTANCE_SENSOR_READINGS
}DISTANCE_SENSOR_READINGS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_DISTANCE_SENSOR_READINGS | 5 | none | Requesting the readings of all infrared distance sensors | PC->MC |
Name | Value | Command data | Description | Direction | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DISTANCE_SENSOR_READINGS | 6 |
|
Response to GET_DISTANCE_SENSOR_READINGS. | MC->PC |
SET_MOTOR_SPEED
Name | Value | Command data | Description | Direction | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_MOTOR_SPEED | 9 |
|
Set the speed set-point for one motor | PC->MC |
GET_ALL_MOTOR_SPEEDS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_ALL_MOTOR_SPEEDS | 10 | none | Requesting the speed of all motors | PC->MC |
ALL_MOTOR_SPEEDS
Name | Value | Command data | Description | Direction | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ALL_MOTOR_SPEEDS | 11 |
|
Response to GET_ALL_MOTOR_SPEEDS. | MC->PC |
SET_MOTOR_POSITION
Name | Value | Command data | Description | Direction | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_MOTOR_POSITION | 12 |
|
Set the position counter of one motor | PC->MC |
GET_ALL_MOTOR_POSITIONS
Name | Value | Command data | Description | Direction | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GET_ALL_MOTOR_POSITIONS | 13 | none | Requesting the position of all motors | PC->MC | ||||||||||||
ALL_MOTOR_POSITIONS | 14 |
|
Response to GET_ALL_MOTOR_POSITIONS. | MC->PC |
SET_MOTOR_PID_PARAMETERS
Name | Value | Command data | Description | Direction | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_MOTOR_PID_PARAMETERS | 15 |
|
Set PID parameters of one motor. | PC->MC |
GET_ALL_MOTOR_PID_PARAMETERS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_ALL_MOTOR_PID_PARAMETERS | 16 | none | Requesting the PID controller parameters of all motors | PC->MC |
ALL_MOTOR_PID_PARAMETERS
Name | Value | Command data | Description | Direction | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ALL_MOTOR_PID_PARAMETERS | 17 |
|
Response to GET_ALL_MOTOR_PID_PARAMETERS. | MC->PC |
SET_ALL_DIGITAL_OUTPUTS
Name | Value | Command data | Description | Direction | ||||||
---|---|---|---|---|---|---|---|---|---|---|
SET_ALL_DIGITAL_OUTPUTS | 18 |
|
Set digital output ports at Robotino's IO connector. | PC->MC |
SET_ALL_RELAYS
Name | Value | Command data | Description | Direction | ||||||
---|---|---|---|---|---|---|---|---|---|---|
SET_ALL_RELAYS | 19 |
|
Set the relays at Robotino's IO connector. | PC->MC |
SET_ODOMETRY
Name | Value | Command data | Description | Direction | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_ODOMETRY | 20 |
|
Set the odometry to the given pose | PC->MC |
SET_ODOMETRY_ROTATION
Name | Value | Command data | Description | Direction | ||||||
---|---|---|---|---|---|---|---|---|---|---|
SET_ODOMETRY_ROTATION | 21 |
|
Set the odometry to the given rotation. Used when a gyroscope is connected to the PC to forward the gyroscope readings to the MC where the odometry is processed. | PC->MC |
GET_ODOMETRY
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_ODOMETRY | 22 | none | Request odometry readings from the MC | PC->MC |
ODOMETRY
Name | Value | Command data | Description | Direction | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ODOMETRY | 23 |
|
Response to GET_ODOMETRY | MC->PC |
GET_ALL_MOTOR_CURRENT_READINGS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_ALL_MOTOR_CURRENT_READINGS | 26 | none | Request current readings from all motors | PC->MC |
ALL_MOTOR_CURRENT_READINGS
Name | Value | Command data | Description | Direction | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ALL_MOTOR_CURRENT_READINGS | 27 |
|
Response to GET_ALL_MOTOR_CURRENT_READINGS. | MC->PC |
GET_ALL_ANALOG_INPUTS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_ALL_ANALOG_INPUTS | 32 | none | Request all analog input readings. | PC->MC |
ALL_ANALOG_INPUTS
Name | Value | Command data | Description | Direction | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ALL_ANALOG_INPUTS | 33 |
|
Response to GET_ALL_ANALOG_INPUTS. Readings of all analog input ports. | MC->PC |
GET_ALL_DIGITAL_INPUTS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_ALL_DIGITAL_INPUTS | 34 | none | Request all digital input readings. | PC->MC |
ALL_DIGITAL_INPUTS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
ALL_DIGITAL_INPUTS | 35 | uint8 | Response to GET_ALL_DIGITAL_INPUTS. Readings of all digital input ports. | MC->PC |
GET_BUMPER
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_BUMPER | 36 | none | Request all digital input readings. | PC->MC |
BUMPER
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
BUMPER | 37 | uint8 | Response to GET_BUMPER. The bumpers state. | MC->PC |
GET_POWER_BUTTON
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_POWER_BUTTON | 38 | none | Request all digital input readings. | PC->MC |
POWER_BUTTON
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
POWER_BUTTON | 39 | uint8 | Response to GET_POWER_BUTTON. The power button state. | MC->PC |
SET_FPGA_POWER
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
SET_FPGA_POWER | 40 | uint8 | Set the FPGA to hold the power supply | PC->MC |
GET_FPGA_POWER
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_FPGA_POWER | 41 | none | Get the FPGA power supply hold status | PC->MC |
FPGA_POWER
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
FPGA_POWER | 42 | uint8 | Response to SET_FPGA_POWER and GET_FPGA_POWER. The FPGA power supply hold status. | MC->PC |
GET_PWR_OK_STATE
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_PWR_OK_STATE | 43 | uint8 | Request status of the PWR_OK line. | PC->MC |
PWR_OK_STATE
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
PWR_OK_STATE | 44 | uint8 | Response to GET_PWR_OK_STATE. Power OK status signal generated by the ATX power
supply to notify the module that the DC operating voltages are within the ranges required for proper operation. |
MC->PC |
SET_PWR_OK_STATE
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
SET_PWR_OK_STATE | 45 | uint8 | Set the PWR_OK line. | PC->MC |
SET_PWM
Name | Value | Command data | Description | Direction | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_PWM | 46 |
|
Set the PWM ratio of a single PWM output. | PC->MC |
SET_MOTOR_ON
Name | Value | Command data | Description | Direction | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_MOTOR_ON | 47 |
|
Enable/Disable a single motor. | PC->MC |
SET_PWRBTN
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
SET_PWRBTN | 48 | uint8 | Set PWRBTN# line. Power button low active signal used to wake up the
system from S5 state (soft off). This signal is triggered on the falling edge. |
PC->MC |
SET_SYS_RESET
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
SET_SYS_RESET | 49 | uint8 | Reset input signal. This signal may be driven to low
by external circuitry such as a reset button to hold the system module in hardware reset. |
PC->MC |
GET_COM_EXPRESS_STATES
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_COM_EXPRESS_STATES | 50 | none | Request status of the COM Express status lines. | PC->MC |
aaaaa
Name | Value | Command data | Description | Direction | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
COM_EXPRESS_STATES | 51 |
|
Response to GET_COM_EXPRESS_STATES. | MC->PC |
GET_ALL_MOTOR_READINGS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_ALL_MOTOR_READINGS | 52 | none | Request speeds, positions, currents from all motors. | PC->MC |
ALL_MOTOR_READINGS
Name | Value | Command data | Description | Direction | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ALL_MOTOR_READINGS | 53 |
|
Response to GET_ALL_MOTOR_READINGS. | MC->PC |
GET_IP_ADDRESS
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
GET_IP_ADDRESS | 54 | none | Request IP4 address. | PC->MC |
IP_ADDRESS
Name | Value | Command data | Description | Direction | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
IP_ADDRESS | 54 |
|
Response to GET_IP_ADDRESS. | MC->PC |
SET_IP_ADDRESS
Name | Value | Command data | Description | Direction | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_IP_ADDRESS | 55 |
|
Set IP4 address. | PC->MC |
SET_EMERGENCY_BUMPER
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
SET_EMERGENCY_BUMPER | 57 | uint8 | 1 enables the emergency bumper feature. 0 disables it. If enabled all motors are stopped for 2s if the Robotino's bumper is hit. | PC->MC |
SET_MOTOR_MODE
Name | Value | Command data | Description | Direction | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
SET_MOTOR_MODE | 58 |
|
Set the control mode of one motor. | PC->MC |
RESET_LPC
Name | Value | Command data | Description | Direction | ||||||
---|---|---|---|---|---|---|---|---|---|---|
RESET_LPC | 59 |
|
Reset the LPC2378 microcontroller. | PC->MC |
INFO
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
INFO | 250 | String | Transmitted to inform about some event. | MC->PC |
WARNING
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
WARNING | 251 | String | Transmitted in case of a warning. | MC->PC |
Name | Value | Command data | Description | Direction |
---|---|---|---|---|
ERROR | 252 | String | Transmitted in case of a communication error. | MC->PC |
Data types
Name | Number of bytes | Description |
---|---|---|
String | Depends of the TAGs data length | Seqeunce of characters. The string is not terminated by 0. |
uint8 | 1 | Unsigned character |
int8 | 1 | Signed character |
uint16 | 2 | Unsigned short. Serialization is little endian. |
int16 | 2 | Signed short. Serialization is little endian. |
uint32 | 4 | Unsigned int. Serialization is little endian. |
int32 | 4 | Signed int. Serialization is little endian. |
float32 | 4 | Floating point number single precision. Serialization is little endian.
//encoding char* data; float f = 1.23f; char* p = (char*)&f; encodingData[0] = *(p++); encodingData[1] = *(p++); encodingData[2] = *(p++); encodingData[3] = *(p++); //decoding float f2; p = (char*)&f2; *(p++) = encodingData[0]; *(p++) = encodingData[1]; *(p++) = encodingData[2]; *(p++) = encodingData[3]; |
Communication example
Communication between PC and MC is driven from the PC. Initially the PC will ask for the hardware and software version of the MC.
Byte number | Value | Description |
---|---|---|
0 | 0xAA | HEAD |
1 | 0x04 | Package length low byte |
2 | 0x00 | Package length high byte |
3 | 0x01 | GET_HW_VERSION |
4 | 0x00 | Data length of GET_HW_VERSION |
5 | 0x03 | GET_SW_VERSION |
6 | 0x00 | Data length of GET_SW_VERSION |
7 | ? | Checksum low byte |
8 | ? | Checksum high byte |
Answer from MC
Byte number | Value | Description |
---|---|---|
0 | 0xAA | HEAD |
1 | 0x0E | Package length low byte |
2 | 0x00 | Package length high byte |
3 | 0x02 | HW_VERSION |
4 | 0x05 | Data length of HW_VERSION |
5 | 0x33 | "3" |
6 | 0x2E | "." |
7 | 0x30 | "0" |
8 | 0x2E | "." |
9 | 0x30 | "0" |
10 | 0x04 | SW_VERSION |
11 | 0x05 | Data length of SW_VERSION |
12 | 0x33 | "3" |
13 | 0x2E | "." |
14 | 0x30 | "0" |
15 | 0x2E | "." |
16 | 0x30 | "0" |
17 | ? | Checksum low byte |
18 | ? | Checksum high byte |