Projekt

Allgemein

Profil

TDT-Protocol on CAN » Historie » Version 103

Maximilian Seesslen, 09.09.2024 18:09

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 103 Maximilian Seesslen
| 0xA    | Ackowledge      |                        |
45
46 1 Maximilian Seesslen
47 94 Maximilian Seesslen
h2. Node-ID
48
49
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.
50
51
|_. Function code |_. Node-ID interpretation|
52
| NMT-Write       | Destination or 0        |
53
| NMT-Send        | Source                  |
54
| NMT-Introduce   | Source                  |
55
| NMT-setId       | New Node-ID             |
56
| Alarms          | Source                  |
57
| Write object    | Destination or 0        |
58
| Read object     | Targeted Source         |
59
| Send object     | Source                  |
60
| Resend object   | Replayed Source         |
61
| data blob       | Destination             |
62 102 Maximilian Seesslen
| Ack             |                         |
63
64 94 Maximilian Seesslen
65 1 Maximilian Seesslen
h1. IDs, ranges and commands
66
67 46 Maximilian Seesslen
h2. Node IDs
68 1 Maximilian Seesslen
69 44 Maximilian Seesslen
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
70 1 Maximilian Seesslen
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
71
72
|_. Range      |_. Decription           |_. Examples              |
73
| 0x01-0x0F    | Network Manager        | PC                      |
74
| 0x10-0x2F    | Active controller      | CANDis                  |
75
| 0x30-0x4F    | Actor                  | CANSwitch               |
76 47 Maximilian Seesslen
| 0x50-0x6F    | Sending sensors        | Sensemux, CANIO         |
77 1 Maximilian Seesslen
| 0x70-0x7F    | Passive Sensors        | CANRec                  |
78
79 75 Maximilian Seesslen
h2. CAN data structutre
80 1 Maximilian Seesslen
81 68 Maximilian Seesslen
|_. Size |_. Decription |_. Examples                                                                                |
82 75 Maximilian Seesslen
| 2      | Object       | Set ambient illumination                                                                  |
83 1 Maximilian Seesslen
| 1      | Unit         | hz, Float, Time, Date, Percent, promilPwm, centiCelsius, canId, room, Multipacket-String  |
84 93 Maximilian Seesslen
| 1      | Flags        | Confirmation required                                                                     |
85 68 Maximilian Seesslen
| 4      | Value        | The kind of data that was specified in 'unit'                                             |
86 36 Maximilian Seesslen
87 44 Maximilian Seesslen
h2. Objects
88 36 Maximilian Seesslen
89 59 Maximilian Seesslen
|_. Code                  |_. Description             |
90
| none                    |                           |
91
| ambientLight            |                           |
92
| plantLight              |                           |
93
| multimediaSwitch        |                           |
94
| mainSwitch              |                           |
95
| date                    |                           |
96
| time                    |                           |
97
| dummy                   |                           |
98
| plantSensor             |                           |
99
| plantSensor [0-7]       |                           |
100
| firmwareVersion         |                           |
101
| firmwareDate            |                           |
102
| hardwareRevision        |                           |
103
| hardwareDate            |                           |
104
| temperatureIntern [0-7] |                           |
105 64 Maximilian Seesslen
| temperatureExtern [0-7] |                           |
106 59 Maximilian Seesslen
| humidity                |                           |
107
| VOC                     |                           |
108 60 Maximilian Seesslen
| Replay                  |                           |
109 63 Maximilian Seesslen
| Data-Dump (SD-Card)     |                           |
110 1 Maximilian Seesslen
111 44 Maximilian Seesslen
h2. Units
112 17 Maximilian Seesslen
113 44 Maximilian Seesslen
* Date: year 2B, month 1B, day 1B
114 1 Maximilian Seesslen
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
115 17 Maximilian Seesslen
116 46 Maximilian Seesslen
h2. Example: Turn on the lights
117 1 Maximilian Seesslen
118 46 Maximilian Seesslen
|_.Data   |_.Size   |_.Description                              |
119 100 Maximilian Seesslen
|0x300    | 29 Bits | Function code: Write Object; All nodes.   |
120 91 Maximilian Seesslen
|0x0      | 2 Byte  | Object: Ambient illumination              |
121 67 Maximilian Seesslen
|0x1      | 1 Byte  | Data-Type: PWM Permill                    |
122 1 Maximilian Seesslen
|0x1      | 1 Byte  | Flags: None                               |
123
|1000     | 4 Byte  | Value: Full Brightness                    |
124 100 Maximilian Seesslen
125
h2. Allerts
126
127
|_.Data   |_.Size   |_.Description                              |
128 101 Maximilian Seesslen
|0x300    | 29 Bits | Function code: Alert                      |
129 100 Maximilian Seesslen
|0x0      | 1 Byte  | Component                                 |
130 101 Maximilian Seesslen
|0x0      | 1 Byte  | Data-Type; 0=good/Gone                    |
131 100 Maximilian Seesslen
|0x0      | 2 Byte  | Allert-Code                               |
132
|1000     | 4 Byte  | Value; Voltage etc.                       |
133
134
The component has to be defined befor including the event-header.
135
The unit is part of the code in the header files.