Read/write driver parameters
It is possible to read or write most of the driver parameters.
info
All here listed messages are unicast with SID = 24
warning
Message - read parameter with index
This command is used to obtain parameters of Driver, indexing in array is possible.
| Payload byte | Description |
|---|---|
| 0 | 0x02 |
| 1 | ID of requested parameter |
| 2 | Index of the member of the array. Use 0x00 index for non-array items. Value 0xFF is reserved for error indication and can not be used for array indexing. |
Response
| Payload byte | Description |
|---|---|
| 0 | 0x42 |
| 1 | ID of requested parameter |
| 2 | Index of the member of the array. Use 0x00 index for non-array items. If the value is 0xFF, following two bytes contains error code. |
| 3 -6 | Data. Length depend on datatype of transfered parameter. (bigendian, MSB first) |
Message - write parameter with index
This command is used to change parameters of Driver. Indexing in array is possible.
| Payload byte | Description |
|---|---|
| 0 | 0x03 |
| 1 | ID of requested parameter |
| 2 | Index of the member of the array. Use 0x00 index for non-array items. Value 0xFF is reserved for error indication and can not be used for array indexing. |
| 3 -6 | Data. Length depend on datatype of transfered parameter. (bigendian, MSB first) |
Response
| Payload byte | Description |
|---|---|
| 0 | 0x43 |
| 1 | ID of requested parameter |
| 2 | Index of the member of the array. Use 0x00 index for non-array items. If the value is 0xFF, following two bytes contains error code. |
| 3 - 4 | If succesfull, these bytes are omnited. Or parameter error response. |
Message - read parameter with index and datatype conversion
This command is used to obtain parameters of Driver. The datatype of parameter will be converted and send with requested datatype.
| Payload byte | Description |
|---|---|
| 0 | 0x12 |
| 1 | ID of requested parameter |
| 2 | Requested type code. For value 0x00 will be used native data format, if the data format is specifed, sent parameter will be converted to this format, if possible. |
Response
| Payload byte | Description |
|---|---|
| 0 | 0x52 |
| 1 | ID of requested parameter |
| 2 | Index of the member of the array. Use 0x00 index for non-array items. If the value is 0xFF, following two bytes contains error code. |
| 3 -6 | Data. Length depend on datatype of transfered parameter. (bigendian, MSB first) |
Message - write parameter with index and datatype conversion
This command is used to change parameters of Driver. The datatype of recieved parameter is in given format.
| Payload byte | Description |
|---|---|
| 0 | 0x13 |
| 1 | ID of requested parameter |
| 2 | Requested type code. For value 0x00 will be used native data format, if the data format is specifed, sent parameter will be converted to this format, if possible. |
| 3 -6 | Data. Length depend on datatype of transfered parameter. (bigendian, MSB first) |
Response
| Payload byte | Description |
|---|---|
| 0 | 0x53 |
| 1 | ID of requested parameter |
| 2 | Index of the member of the array. Use 0x00 index for non-array items. If the value is 0xFF, following two bytes contains error code. |
| 3 - 4 | If succesfull, these bytes are omnited. Or parameter error response. |
Datatypes code
| Datatype code | Datatype |
|---|---|
| 0x00 | not specified, use native datatype |
| 0x01 | int8 |
| 0x02 | uint8 |
| 0x03 | int16 |
| 0x04 | uint16 |
| 0x05 | int32 |
| 0x06 | uint32 |
| 0x09 | float |
| 0x0B | string |
Parameter error response
| Response | Description |
|---|---|
| -1 | Parameter id out of range. (invalid value) |
| -2 | Parameter not exist |
| -3 | Variable exists, but it is not parameter (unable to write) |
| -4 | Send value is lower than parameter minimum |
| -5 | Send value is higher than parameter maximum |
| -6 | Parameter is discrete. Wrong value. |
Message - read API version and driver type
| Payload byte | Description |
|---|---|
| 0 | 0x00 |
Response
| Payload byte | Description |
|---|---|
| 0 | 0x40 |
| 1 | Driver type. VECTOR = 0x20, BLDC = 0x10 |
| 2-5 | [uint32] Driver API version |
Actual API version is 2