Driver Task Execution
This document describes how to issue task execution commands through the ESCx driver API.
info
- All datagram types listed here are unicast with SID = 24
- All payloads listed here use big-endian byte order
Interface Configuration
Advanced
Message - Execute Task
Controller receivingCAN ID:
0x0C7(24 << 3) + 7 host address|Controller address: 0x00| Datagram byte | Value / type | Description |
|---|---|---|
| 0 | 0x00 | Controller address (link layer) |
| 1 | 0x04 | Execute task command |
| 2 | uint8 | Task ID |
| 3 (optional) | uint8 | Argument count (argcnt, 0 - 4) |
| 4-7 (optional) | uint8[4] | Argument data. See Argument Encoding. |
New in driver 5.2
Task arguments (argcnt and the argument bytes) are supported starting from driver firmware 5.2. Earlier driver versions ignore them and the task always runs with its default parameters. Omit byte 2 (or send argcnt = 0) to stay backward-compatible.
Task ID List
| Task ID | Description |
|---|---|
| 1 | Driver reinit |
| 2 | Execute identlin |
| 3 | Execute identrun |
| 128 | Save parameters |
| 129 | Load parameters from flash |
| 255 | Request task result |
| Other | Unsupported command |
Argument Encoding
The meaning of payload bytes 3 - 6 depends on argcnt:
argcnt | Layout of bytes 3 - 6 |
|---|---|
| 0 (or omitted) | No arguments — task uses defaults |
| 1 | 1 × uint32 (big-endian) in bytes 3 - 6 |
| 2 | 2 × uint16 (big-endian): u16[0] in bytes 3 - 4, u16[1] in bytes 5 - 6 |
| 3 | 3 × uint8 in bytes 3 - 5 |
| 4 | 4 × uint8 in bytes 3 - 6 |
Per-task Arguments
Task 1 — Driver reinit
argcnt | Argument | Meaning |
|---|---|---|
| 0 | — | Reinit and start with current preset |
| 1 | u32 | Preset id — selected before driver start |
Task 2 — identlin
argcnt | Argument data | Meaning |
|---|---|---|
| 0 | — | Defaults: flags = NLIN | PID, cycles = 10000, currthr = iref / 2 |
| 1 | u32 | cycles = u32 (raw) |
| 2 | u16, u16 | cycles = u16[0] (raw); currthr = iref × u16[1] / 10000 (0.01 % of iref) |
| 3 or 4 | u8 flags, u8 cyc, u8 cur [, u8 flags_hi] | flags = arg0 ; cycles = arg1 × 20000 ; currthr = iref × arg2 / 100 ; argcnt = 4: flags |= arg3 << 8 |
Task 3 — identrun
argcnt | Argument data | Meaning |
|---|---|---|
| 0 | — | Defaults: acc = 200, cycles = 80000, currthr = iref / 4 |
| 1 | u32 | cycles = u32 (raw) |
| 2 | u16, u16 | cycles = u16[0] (raw); currthr = iref × u16[1] / 10000 (0.01 % of iref) |
| 3 or 4 | u8 acc, u8 cyc, u8 cur [, u8 unused] | acc = arg0 × 100 ; cycles = arg1 × 20000 ; currthr = iref × arg2 / 100 |
Tasks 128 / 129 — Save / Load parameters
No arguments. Send argcnt = 0 or omit byte 2 entirely.
Response
Task is Being Executed
Controller sendingCAN ID:
0x0C0(24 << 3) + 0 controller address|Host address: 0x07| Datagram byte | Value / type | Description |
|---|---|---|
| 0 | 0x07 | Host address (link layer) |
| 1 | 0x44 | Task response indicator |
| 2 | uint8 | Task ID |
Task Result Response
Controller sendingCAN ID:
0x0C0(24 << 3) + 0 controller address|Host address: 0x07| Datagram byte | Value / type | Description |
|---|---|---|
| 0 | 0x07 | Host address (link layer) |
| 1 | 0x44 | Task response indicator |
| 2 | uint8 | Task ID |
| 3-6 | int32 | Task return value |
The return value indicates the execution result of the task/command. A value of 0 always indicates successful completion.
| Return value | Description |
|---|---|
| 0 | Success |
| -1 | Task not supported |
| Other | Task specific return value - error |
Message - Motor Beep
Controller receivingCAN ID:
0x0C7(24 << 3) + 7 host address|Controller address: 0x00| Datagram byte | Value / type | Description |
|---|---|---|
| 0 | 0x00 | Controller address (link layer) |
| 1 | 0x06 | Motor beep command |
| 2-3 | int16 | Beep volume |
| 4-5 | int16 | Beep tone |
This message does not generate a response