Projekt

Allgemein

Profil

TDT-Protocol on CAN » Historie » Version 101

Maximilian Seesslen, 01.02.2024 18:07

1 12 Maximilian Seesslen
h1. Intro
2 1 Maximilian Seesslen
3 95 Maximilian Seesslen
With the TDT-Protocol sensors can send their values on the BUS without necessarily knowing about complex object catalogue.
4
An monitor-software is able to display sensor values of nodes without knowing anything about the sensors or their configuration.
5
An XML file can be used for supplement for an monitor software.
6
The CANId consists of an function code and the node id. Like CANOpen the function code is 4 Bits and the Node-ID is 7 Bit.
7 46 Maximilian Seesslen
In CAN2.0A there can only be 128 Nodes.
8 1 Maximilian Seesslen
9 35 Maximilian Seesslen
CAN 2.0A: 0..0x7FF
10
CANOpen: 4 Bit Function code, 7 Bit Node-ID
11
Node-Id: 0..0x7F
12 1 Maximilian Seesslen
Function-Code Mask: 0x780
13 46 Maximilian Seesslen
There are 14 or 28 Filters on STM32Fs
14
Some STM32 have an internal 96-bit unique ID.
15 1 Maximilian Seesslen
16 74 Maximilian Seesslen
|_. Bits |_. Area   |_. Decription        |_. Examples             |
17 73 Maximilian Seesslen
| 4      |/2.CAN-Id | Function code       | Send object            |
18 74 Maximilian Seesslen
| 7      |            NodeId              | Sensemux WZ            |
19
| 16 	 |/4.Data   | Object 	          | Set illumination       |
20
| 8 	 |            Unit 	          | promilPwm              |
21
| 8 	 |            Flags 	          | Confirmation required  | 
22
| 32 	 |            Value 	          | 350‰                   |
23 98 Maximilian Seesslen
| _64Bits Data_ |      |                     |                        |
24 71 Maximilian Seesslen
25 87 Maximilian Seesslen
[[NMT]]
26
[[MMP]]
27 89 Maximilian Seesslen
[[Alerts]]
28 87 Maximilian Seesslen
29 44 Maximilian Seesslen
h2. Function code
30 86 Maximilian Seesslen
31 83 Maximilian Seesslen
Function code can be 0..15 / 0x00..0x0F
32 44 Maximilian Seesslen
33 1 Maximilian Seesslen
|_. Code |_. Decription    |_. Examples             |
34 51 Maximilian Seesslen
| 0x0    | NMT-Write       |                        |
35 1 Maximilian Seesslen
| 0x1    | NMT-Send        |                        |
36 79 Maximilian Seesslen
| 0x2    | NMT-Introduce   | Device sends UID only  |
37 82 Maximilian Seesslen
| 0x3    | NMT-setId       | Set NodeId on Device   |
38 90 Maximilian Seesslen
| 0x4    | Alarms          | Send by nodes          |
39 82 Maximilian Seesslen
| 0x5    | Write object    | Set Date, illumination |
40
| 0x6    | Read object     | Get product codes      |
41
| 0x7    | Send object     | Send temperature       |
42
| 0x8    | Resend object   | Replay recorded data   |
43 58 Maximilian Seesslen
| 0x9    | data blob       |                        |
44 1 Maximilian Seesslen
45 94 Maximilian Seesslen
h2. Node-ID
46
47
Depending on the function code, the Node-ID can be the target or the source. Node-ID '0' means every node should inspect the message.
48
49
|_. Function code |_. Node-ID interpretation|
50
| NMT-Write       | Destination or 0        |
51
| NMT-Send        | Source                  |
52
| NMT-Introduce   | Source                  |
53
| NMT-setId       | New Node-ID             |
54
| Alarms          | Source                  |
55
| Write object    | Destination or 0        |
56
| Read object     | Targeted Source         |
57
| Send object     | Source                  |
58
| Resend object   | Replayed Source         |
59
| data blob       | Destination             |
60
61 1 Maximilian Seesslen
h1. IDs, ranges and commands
62
63 46 Maximilian Seesslen
h2. Node IDs
64 1 Maximilian Seesslen
65 44 Maximilian Seesslen
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
66 1 Maximilian Seesslen
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
67
68
|_. Range      |_. Decription           |_. Examples              |
69
| 0x01-0x0F    | Network Manager        | PC                      |
70
| 0x10-0x2F    | Active controller      | CANDis                  |
71
| 0x30-0x4F    | Actor                  | CANSwitch               |
72 47 Maximilian Seesslen
| 0x50-0x6F    | Sending sensors        | Sensemux, CANIO         |
73 1 Maximilian Seesslen
| 0x70-0x7F    | Passive Sensors        | CANRec                  |
74
75 75 Maximilian Seesslen
h2. CAN data structutre
76 1 Maximilian Seesslen
77 68 Maximilian Seesslen
|_. Size |_. Decription |_. Examples                                                                                |
78 75 Maximilian Seesslen
| 2      | Object       | Set ambient illumination                                                                  |
79 1 Maximilian Seesslen
| 1      | Unit         | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String  |
80 93 Maximilian Seesslen
| 1      | Flags        | Confirmation required                                                                     |
81 68 Maximilian Seesslen
| 4      | Value        | The kind of data that was specified in 'unit'                                             |
82 36 Maximilian Seesslen
83 44 Maximilian Seesslen
h2. Objects
84 36 Maximilian Seesslen
85 59 Maximilian Seesslen
|_. Code                  |_. Description             |
86
| none                    |                           |
87
| ambientLight            |                           |
88
| plantLight              |                           |
89
| multimediaSwitch        |                           |
90
| mainSwitch              |                           |
91
| date                    |                           |
92
| time                    |                           |
93
| dummy                   |                           |
94
| plantSensor             |                           |
95
| plantSensor [0-7]       |                           |
96
| firmwareVersion         |                           |
97
| firmwareDate            |                           |
98
| hardwareRevision        |                           |
99
| hardwareDate            |                           |
100
| temperatureIntern [0-7] |                           |
101 64 Maximilian Seesslen
| temperatureExtern [0-7] |                           |
102 59 Maximilian Seesslen
| humidity                |                           |
103
| VOC                     |                           |
104 60 Maximilian Seesslen
| Replay                  |                           |
105 63 Maximilian Seesslen
| Data-Dump (SD-Card)     |                           |
106 1 Maximilian Seesslen
107 44 Maximilian Seesslen
h2. Units
108 17 Maximilian Seesslen
109 44 Maximilian Seesslen
* Date: year 2B, month 1B, day 1B
110 1 Maximilian Seesslen
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
111 17 Maximilian Seesslen
112 46 Maximilian Seesslen
h2. Example: Turn on the lights
113 1 Maximilian Seesslen
114 46 Maximilian Seesslen
|_.Data   |_.Size   |_.Description                              |
115 100 Maximilian Seesslen
|0x300    | 29 Bits | Function code: Write Object; All nodes.   |
116 91 Maximilian Seesslen
|0x0      | 2 Byte  | Object: Ambient illumination              |
117 67 Maximilian Seesslen
|0x1      | 1 Byte  | Data-Type: PWM Permill                    |
118 1 Maximilian Seesslen
|0x1      | 1 Byte  | Flags: None                               |
119
|1000     | 4 Byte  | Value: Full Brightness                    |
120 100 Maximilian Seesslen
121
h2. Allerts
122
123
|_.Data   |_.Size   |_.Description                              |
124 101 Maximilian Seesslen
|0x300    | 29 Bits | Function code: Alert                      |
125 100 Maximilian Seesslen
|0x0      | 1 Byte  | Component                                 |
126 101 Maximilian Seesslen
|0x0      | 1 Byte  | Data-Type; 0=good/Gone                    |
127 100 Maximilian Seesslen
|0x0      | 2 Byte  | Allert-Code                               |
128
|1000     | 4 Byte  | Value; Voltage etc.                       |
129
130
The component has to be defined befor including the event-header.
131
The unit is part of the code in the header files.