Servosila-SC-25-Programming-Guide

Decoding TELEMETRY
See sample C++ projects slcan-telemetry and canbus-telemetry for an example of
how to receive and decode a telemetry message coming from a Servosila SC-25 Brushless Motor
Controllers.
CAN ID Analysis & Decoding Example (C++)
//Extract Node ID from CAN ID
uint32_t extract_node_id_from_can_id(uint32_t can_id)
{
//assert(can_id<=2047); //11bit only
const uint32_t node_id = can_id & 127; //0000-1111111
return node_id;
}
//Extract COB ID from CAN ID
uint32_t extract_cob_id_from_can_id(uint32_t can_id)
{
//assert(can_id<=2047); //11bit only
const uint32_t cob_id = can_id & 0x780; //1111-0000000
return cob_id;
}
16 www.servosila.com
Node ID + COB ID
Payload (8 bytes, binary)CAN ID (11 bits)
0 1 2 3 4 5 6 7
Node ID (source device)
The parameter is a unique identifier assigned to each controller.
This parameter tells what controller the telemetry message comes from
Telemetry payload section
Each of telemetry messages carries parameters (data) in the Payload array.
The parameters of each of the telemetry messages, their data types and
positions in the Payload are listed in Servosila Device Reference document.
COB ID
There are just 4 telemetry COB IDs: 0x180, 0x280, 0x380, 0x480.
COB ID of a telemetry message tells how to decode it.
For each of the COB IDs there is a Payload format definition
in Servosila Device Reference document.