Projekt

Allgemein

Profil

TDT-Protocol on CAN » Historie » Version 45

Maximilian Seesslen, 20.01.2023 11:22

1 12 Maximilian Seesslen
h1. Intro
2 1 Maximilian Seesslen
3 17 Maximilian Seesslen
With the TDT-Protocol sensors can just send their values on the BUS without complex object catalogue.
4
An monitor-software is able to display values without knowing anything about the sensors or their configuration.
5 24 Maximilian Seesslen
The CANId of sensors is actually their configurable ID or an global command.
6 1 Maximilian Seesslen
7 35 Maximilian Seesslen
CAN 2.0A: 0..0x7FF
8
CANOpen: 4 Bit Function code, 7 Bit Node-ID
9
Node-Id: 0..0x7F
10
Function-Code Mask: 0x780
11 1 Maximilian Seesslen
12 44 Maximilian Seesslen
h2. Function code
13
14 1 Maximilian Seesslen
|_. Code |_. Decription    |_. Examples             |
15 44 Maximilian Seesslen
| 0x0    | NMT             |                        |
16
| 0x1    | Alarms          |                        |
17
| 0x6    | Write object    | Set Date, illumination |
18
| 0x7    | Read object     | Get product codes      |
19
| 0x8    | Send object     | Send temperature       |
20
| 0x9    | data blob       |                        |
21
| 0xC    | log             |                        |
22 28 Maximilian Seesslen
23 1 Maximilian Seesslen
h1. IDs, ranges and commands
24
25
h2. CAN IDs
26
27 44 Maximilian Seesslen
* 11-Bit-Identifier, (CAN 2.0A); 2048; 0x0 ... 0x7F0; 0x0 ... 0x7F with function code
28 1 Maximilian Seesslen
* 29-Bit-Identifier, (CAN 2.0B); 0x20000000
29
30
|_. Range      |_. Decription           |_. Examples              |
31
| 0x01-0x0F    | Network Manager        | PC                      |
32
| 0x10-0x2F    | Active controller      | CANDis                  |
33
| 0x30-0x4F    | Actor                  | CANSwitch               |
34
| 0x50-0x6F    | Sending sensors        | Sensemux                |
35
| 0x70-0x7F    | Passive Sensors        | CANRec                  |
36
37 45 Maximilian Seesslen
h2. Object structutre
38 1 Maximilian Seesslen
39 44 Maximilian Seesslen
|_. Size |_. Decription |_. Examples                                                       |
40
| 2      | Object       | Plain Sensor value; Set illumination                             |
41
| 1      | Data type    | Int, Float, Time, Date, Percent, Promil, Multipacket-String      |
42
| 1      | Unit         | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room         |
43
| 4      | Value        | 32Bit                                                            |
44 36 Maximilian Seesslen
45 44 Maximilian Seesslen
h2. Objects
46 36 Maximilian Seesslen
47 44 Maximilian Seesslen
|_. Code             |_. Description             |
48
| none               |                           |
49
| ambientLight       |                           |
50
| plantLight         |                           |
51
| multimediaSwitch   |                           |
52
| mainSwitch         |                           |
53
| date               |                           |
54
| time               |                           |
55
| dummy              |                           |
56
| plantSensor        |                           |
57
| plantSensor0       |                           |
58
| plantSensor1       |                           |
59
| plantSensor2       |                           |
60
| plantSensor3       |                           |
61
| plantSensor4       |                           |
62
| firmwareVersion    |                           |
63
| firmwareDate       |                           |
64
| hardwareRevision   |                           |
65
| hardwareDate       |                           |
66
| temperatureIntern  |                           |
67
| temperatureIntern1 |                           |
68
| temperatureIntern2 |                           |
69
| temperatureIntern3 |                           |
70
| temperatureIntern4 |                           |
71
| temperatureExtern  |                           |
72
| temperatureExtern1 |                           |
73
| temperatureExtern2 |                           |
74
| temperatureExtern3 |                           |
75
| temperatureExtern4 |                           |
76
| humidity           |                           |
77
| voc                |                           |
78 1 Maximilian Seesslen
79 44 Maximilian Seesslen
h2. Units
80 17 Maximilian Seesslen
81 44 Maximilian Seesslen
* Date: year 2B, month 1B, day 1B
82
* Time: hour 1B, minute 1B, second 1B, subsecond 1B
83 17 Maximilian Seesslen
84
85
h1. Multipacket-Strings
86
87
|_. Address |_. Type          |
88
| 0x0       | Package count   |
89
| 0x1       | Package number  |
90
| 0x2..0x3  | Data            |
91 1 Maximilian Seesslen
92 18 Maximilian Seesslen
h1. Actuator introduction
93
94
When introduction is requested by system command, each device must send description for each subid.
95 23 Maximilian Seesslen
96
h1. Example
97 27 Maximilian Seesslen
98
h2. Turn on the lights
99
100
|_.Data   |_.Size   |_.Description                 |
101
|0x100    | 29 Bits | CAN-Id: Global command       |
102
|0x0      | 1 Byte  | Message-Type: Global command |
103
|0x0 	  | 1 Byte  | Sub-Id: Set ambient light    |
104
|0x1      | 1 Byte  | Data-Type: Integer           |
105 15 Maximilian Seesslen
|0x1      | 1 Byte  | PWM: PWM permilli            |
106
|1000     | 4 Byte  | Value: Full Brightness       |
107
108
109
h1. Usecases
110 25 Maximilian Seesslen
111
* simple actors can filter message to "Global actuator" messages, at least "system commands"
112
* There are 14 or 28 Filters on STM32Fs
113
114
h1. ID Assigning
115
116
Some STM32 have an internal 96-bit unique ID.
117
118
h1. V2
119
120
|_. Size |_. Decription |_. Examples                                                       |
121
| 1      | Packet type  | Standard TDT packet                                              |
122
| 1      | Sub-Id;      | Futher index; Sub-Sensor or more specifi kind of thing to be set |
123
| 1      | Data type    | Int, Float, Time, Date, Percent, Promil, Multipacket-String      |
124
| 1      | Unit         | Hz, °C, Time, Date, PWM, CAN-ID, Name, Description, Room         |
125
| 4      | Value        | 32Bit                                                            |
126 30 Maximilian Seesslen
127 31 Maximilian Seesslen
h2. Multimessage package
128
129 30 Maximilian Seesslen
There should be the posssibillity to write the complete SPI-Flash even if it takes forever.
130 32 Maximilian Seesslen
Not every slave needs to be able to send super big blocks. But every slave should be able to
131
send e.g. descriptions.
132 25 Maximilian Seesslen
133
* Is order of messages an issue? Multiple Mailboxes.
134
135
|_. Size |_. Decription |_. Examples                                                       |
136
| 1      | Packet type  | Multimessage package                                             |
137
| 1      | count        | Number of packages                                               |
138
| 1      | number       | 0: value=data length in bytes                                    |
139
| 4      | Value        | 32Bit                                                            |
140
141
|_. Size |_. Decription |_. Examples                                                       |
142
| 1      | Packet type  | Multimessage package 2                                           |
143
| 1      | id           | Mailbox                                                          |
144 31 Maximilian Seesslen
| 1      | number       | 0: value=data length in bytes                                    |
145 30 Maximilian Seesslen
|        |              | 1: value=number of messages                                      |
146
|        |              | 2..x: data                                                       |
147 1 Maximilian Seesslen
| 4      | Value        | 32Bit                                                            |
148
149
h2. Diagnose