Skip to main content
Firmware Stable

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 byteValue / typeDescription
00x00Controller address (link layer)
10x04Execute task command
2uint8Task ID
3 (optional)uint8Argument 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 IDDescription
1Driver reinit
2Execute identlin
3Execute identrun
128Save parameters
129Load parameters from flash
255Request task result
OtherUnsupported command

Argument Encoding

The meaning of payload bytes 3 - 6 depends on argcnt:

argcntLayout of bytes 3 - 6
0 (or omitted)No arguments — task uses defaults
11 × uint32 (big-endian) in bytes 3 - 6
22 × uint16 (big-endian): u16[0] in bytes 3 - 4, u16[1] in bytes 5 - 6
33 × uint8 in bytes 3 - 5
44 × uint8 in bytes 3 - 6

Per-task Arguments

Task 1 — Driver reinit

argcntArgumentMeaning
0Reinit and start with current preset
1u32Preset id — selected before driver start

Task 2 — identlin

argcntArgument dataMeaning
0Defaults: flags = NLIN | PID, cycles = 10000, currthr = iref / 2
1u32cycles = u32 (raw)
2u16, u16cycles = u16[0] (raw); currthr = iref × u16[1] / 10000 (0.01 % of iref)
3 or 4u8 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

argcntArgument dataMeaning
0Defaults: acc = 200, cycles = 80000, currthr = iref / 4
1u32cycles = u32 (raw)
2u16, u16cycles = u16[0] (raw); currthr = iref × u16[1] / 10000 (0.01 % of iref)
3 or 4u8 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 byteValue / typeDescription
00x07Host address (link layer)
10x44Task response indicator
2uint8Task ID

Task Result Response

Controller sendingCAN ID: 0x0C0(24 << 3) + 0 controller address|Host address: 0x07
Datagram byteValue / typeDescription
00x07Host address (link layer)
10x44Task response indicator
2uint8Task ID
3-6int32Task return value

The return value indicates the execution result of the task/command. A value of 0 always indicates successful completion.

Return valueDescription
0Success
-1Task not supported
OtherTask specific return value - error

Message - Motor Beep

Controller receivingCAN ID: 0x0C7(24 << 3) + 7 host address|Controller address: 0x00
Datagram byteValue / typeDescription
00x00Controller address (link layer)
10x06Motor beep command
2-3int16Beep volume
4-5int16Beep tone

This message does not generate a response