TDT-Protocol on CAN » Historie » Revision 58
Revision 57 (Maximilian Seesslen, 31.01.2023 17:37) → Revision 58/104 (Maximilian Seesslen, 13.02.2023 14:50)
h1. Intro
With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue.
An monitor-software is able to display values without knowing anything about the sensors or their configuration.
The CANId cinsists of an function code and the node id. Like CANOpen the function code is 4 Bits and the Node-ID is 7 Bit.
In CAN2.0A there can only be 128 Nodes.
CAN 2.0A: 0..0x7FF
CANOpen: 4 Bit Function code, 7 Bit Node-ID
Node-Id: 0..0x7F
Function-Code Mask: 0x780
There are 14 or 28 Filters on STM32Fs
Some STM32 have an internal 96-bit unique ID.
h2. Function code
|_. Code |_. Decription |_. Examples |
| 0x0 | NMT-Write | |
| 0x1 | NMT-Send | |
| 0x2 | Alarms | |
| 0x3 0x6 | Write object | Set Date, illumination |
| 0x4 0x7 | Read object | Get product codes |
| 0x5 0x8 | Send object | Send temperature |
| 0x6 0x9 | Resend object | Replay recorded data blob | |
| 0x7 0xC | data blob log | |
h1. IDs, ranges and commands
h2. Node IDs
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
|_. Range |_. Decription |_. Examples |
| 0x01-0x0F | Network Manager | PC |
| 0x10-0x2F | Active controller | CANDis |
| 0x30-0x4F | Actor | CANSwitch |
| 0x50-0x6F | Sending sensors | Sensemux, CANIO |
| 0x70-0x7F | Passive Sensors | CANRec |
h2. Object structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object | Plain Sensor value; Set illumination |
| 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String |
| 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room |
| 4 | Value | 32Bit |
h2. Objects
|_. Code |_. Description |
| none | |
| ambientLight | |
| plantLight | |
| multimediaSwitch | |
| mainSwitch | |
| date | |
| time | |
| dummy | |
| plantSensor | |
| plantSensor0 | |
| plantSensor1 | |
| plantSensor2 | |
| plantSensor3 | |
| plantSensor4 | |
| firmwareVersion | |
| firmwareDate | |
| hardwareRevision | |
| hardwareDate | |
| temperatureIntern | |
| temperatureIntern1 | |
| temperatureIntern2 | |
| temperatureIntern3 | |
| temperatureIntern4 | |
| temperatureExtern | |
| temperatureExtern1 | |
| temperatureExtern2 | |
| temperatureExtern3 | |
| temperatureExtern4 | |
| humidity | |
| voc | |
h2. Units
* Date: year 2B, month 1B, day 1B
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
h2. Example: Turn on the lights
|_.Data |_.Size |_.Description |
|0x300 | 29 Bits | Function code: Write Object; All objects. |
|0x0 | 2 Byte | Message-Type: Global command |
|0x1 | 1 Byte | Data-Type: Permill |
|0x1 | 1 Byte | PWM: PWM permilli |
|1000 | 4 Byte | Value: Full Brightness |
h1. Multipacket-Strings
There should be the posssibillity to write the complete SPI-Flash even if it takes forever.
Not every slave needs to be able to send super big blocks. But every slave should be able to
send e.g. descriptions.
|_. Size |_. Type |
| 0x4 | Package number (0: Data contains package count) |
| 0x4 | Data |
h1. NMT
h2. Actuator introduction
When introduction is requested by system command, each device must send an description.
|_. Size |_. Decription |_. Examples |
| 2 | Object | Object |
| 6 | MAC/Unique ID| 48Bit |
h3. Objects
|_. Size |_. Decription |
|1 | Request intoruction |
|2 | MAC low |
|3 | MAC high |
|4 | Protocol versions |
|5 | Firmware version |
|6 | Product Code |
|7 | Node-Id |
h3. Protocol versions
|_. Size |_. Decription |
|1 | TDT Major |
|1 | TDT Minor |
|1 | NMT Major |
|1 | NMT Minor |
|1 | Blob Major |
|1 | Blob Minor |
h1. V2
|_. Size |_. Decription |_. Examples |
| 1 | Packet type | Standard TDT packet |
| 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set |
| 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String |
| 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room |
| 4 | Value | 32Bit |
h2. Multimessage package
There should be the posssibillity to write the complete SPI-Flash even if it takes forever.
Not every slave needs to be able to send super big blocks. But every slave should be able to
send e.g. descriptions.
With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue.
An monitor-software is able to display values without knowing anything about the sensors or their configuration.
The CANId cinsists of an function code and the node id. Like CANOpen the function code is 4 Bits and the Node-ID is 7 Bit.
In CAN2.0A there can only be 128 Nodes.
CAN 2.0A: 0..0x7FF
CANOpen: 4 Bit Function code, 7 Bit Node-ID
Node-Id: 0..0x7F
Function-Code Mask: 0x780
There are 14 or 28 Filters on STM32Fs
Some STM32 have an internal 96-bit unique ID.
h2. Function code
|_. Code |_. Decription |_. Examples |
| 0x0 | NMT-Write | |
| 0x1 | NMT-Send | |
| 0x2 | Alarms | |
| 0x3 0x6 | Write object | Set Date, illumination |
| 0x4 0x7 | Read object | Get product codes |
| 0x5 0x8 | Send object | Send temperature |
| 0x6 0x9 | Resend object | Replay recorded data blob | |
| 0x7 0xC | data blob log | |
h1. IDs, ranges and commands
h2. Node IDs
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
|_. Range |_. Decription |_. Examples |
| 0x01-0x0F | Network Manager | PC |
| 0x10-0x2F | Active controller | CANDis |
| 0x30-0x4F | Actor | CANSwitch |
| 0x50-0x6F | Sending sensors | Sensemux, CANIO |
| 0x70-0x7F | Passive Sensors | CANRec |
h2. Object structutre
|_. Size |_. Decription |_. Examples |
| 2 | Object | Plain Sensor value; Set illumination |
| 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String |
| 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room |
| 4 | Value | 32Bit |
h2. Objects
|_. Code |_. Description |
| none | |
| ambientLight | |
| plantLight | |
| multimediaSwitch | |
| mainSwitch | |
| date | |
| time | |
| dummy | |
| plantSensor | |
| plantSensor0 | |
| plantSensor1 | |
| plantSensor2 | |
| plantSensor3 | |
| plantSensor4 | |
| firmwareVersion | |
| firmwareDate | |
| hardwareRevision | |
| hardwareDate | |
| temperatureIntern | |
| temperatureIntern1 | |
| temperatureIntern2 | |
| temperatureIntern3 | |
| temperatureIntern4 | |
| temperatureExtern | |
| temperatureExtern1 | |
| temperatureExtern2 | |
| temperatureExtern3 | |
| temperatureExtern4 | |
| humidity | |
| voc | |
h2. Units
* Date: year 2B, month 1B, day 1B
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
h2. Example: Turn on the lights
|_.Data |_.Size |_.Description |
|0x300 | 29 Bits | Function code: Write Object; All objects. |
|0x0 | 2 Byte | Message-Type: Global command |
|0x1 | 1 Byte | Data-Type: Permill |
|0x1 | 1 Byte | PWM: PWM permilli |
|1000 | 4 Byte | Value: Full Brightness |
h1. Multipacket-Strings
There should be the posssibillity to write the complete SPI-Flash even if it takes forever.
Not every slave needs to be able to send super big blocks. But every slave should be able to
send e.g. descriptions.
|_. Size |_. Type |
| 0x4 | Package number (0: Data contains package count) |
| 0x4 | Data |
h1. NMT
h2. Actuator introduction
When introduction is requested by system command, each device must send an description.
|_. Size |_. Decription |_. Examples |
| 2 | Object | Object |
| 6 | MAC/Unique ID| 48Bit |
h3. Objects
|_. Size |_. Decription |
|1 | Request intoruction |
|2 | MAC low |
|3 | MAC high |
|4 | Protocol versions |
|5 | Firmware version |
|6 | Product Code |
|7 | Node-Id |
h3. Protocol versions
|_. Size |_. Decription |
|1 | TDT Major |
|1 | TDT Minor |
|1 | NMT Major |
|1 | NMT Minor |
|1 | Blob Major |
|1 | Blob Minor |
h1. V2
|_. Size |_. Decription |_. Examples |
| 1 | Packet type | Standard TDT packet |
| 1 | Sub-Id; | Futher index; Sub-Sensor or more specifi kind of thing to be set |
| 1 | Data type | Int, Float, Time, Date, Percent, Promil, Multipacket-String |
| 1 | Unit | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room |
| 4 | Value | 32Bit |
h2. Multimessage package
There should be the posssibillity to write the complete SPI-Flash even if it takes forever.
Not every slave needs to be able to send super big blocks. But every slave should be able to
send e.g. descriptions.