61 // OBJECT DICTIONARY |
61 // OBJECT DICTIONARY |
62 // |
62 // |
63 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ |
63 //$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ |
64 |
64 |
65 /* index 0x1000 : Device Type. */ |
65 /* index 0x1000 : Device Type. */ |
66 UNS32 TestSlave_obj1000 = 0x12D; |
66 UNS32 TestSlave_obj1000 = 0x12D; // 301 |
67 subindex TestSlave_Index1000[] = |
67 subindex TestSlave_Index1000[] = |
68 { |
68 { |
69 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 } |
69 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1000 } |
70 }; |
70 }; |
71 |
71 |
72 /* index 0x1001 : Error Register. */ |
72 /* index 0x1001 : Error Register. */ |
73 UNS8 TestSlave_obj1001 = 0x0; |
73 UNS8 TestSlave_obj1001 = 0x0; // 0 |
74 subindex TestSlave_Index1001[] = |
74 subindex TestSlave_Index1001[] = |
75 { |
75 { |
76 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 } |
76 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_obj1001 } |
77 }; |
77 }; |
78 |
78 |
79 /* index 0x1005 : SYNC COB ID. */ |
79 /* index 0x1005 : SYNC COB ID. */ |
80 UNS32 TestSlave_obj1005 = 0x80; |
80 UNS32 TestSlave_obj1005 = 0x80; // 128 |
81 ODCallback_t TestSlave_Index1005_callbacks[] = |
81 ODCallback_t TestSlave_Index1005_callbacks[] = |
82 { |
82 { |
83 NULL, |
83 NULL, |
84 }; |
84 }; |
85 subindex TestSlave_Index1005[] = |
85 subindex TestSlave_Index1005[] = |
86 { |
86 { |
87 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 } |
87 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1005 } |
88 }; |
88 }; |
89 |
89 |
90 /* index 0x1006 : Communication / Cycle Period. */ |
90 /* index 0x1006 : Communication / Cycle Period. */ |
91 UNS32 TestSlave_obj1006 = 0x0; |
91 UNS32 TestSlave_obj1006 = 0x0; // 0 |
92 ODCallback_t TestSlave_Index1006_callbacks[] = |
92 ODCallback_t TestSlave_Index1006_callbacks[] = |
93 { |
93 { |
94 NULL, |
94 NULL, |
95 }; |
95 }; |
96 subindex TestSlave_Index1006[] = |
96 subindex TestSlave_Index1006[] = |
97 { |
97 { |
98 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 } |
98 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1006 } |
|
99 }; |
|
100 |
|
101 /* index 0x1010 : Store parameters. */ |
|
102 UNS8 TestSlave_highestSubIndex_obj1010 = 4; // number of subindex - 1 |
|
103 UNS32 TestSlave_obj1010_Save_All_Parameters = 0x0; // 0 |
|
104 UNS32 TestSlave_obj1010_Save_Communication_Parameters = 0x0; // 0 |
|
105 UNS32 TestSlave_obj1010_Save_Application_Parameters = 0x0; // 0 |
|
106 UNS32 TestSlave_obj1010_Save_Manufacturer_Parameters = 0x0; // 0 |
|
107 ODCallback_t TestSlave_Index1010_callbacks[] = |
|
108 { |
|
109 NULL, |
|
110 NULL, |
|
111 NULL, |
|
112 NULL, |
|
113 NULL, |
|
114 }; |
|
115 subindex TestSlave_Index1010[] = |
|
116 { |
|
117 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1010 }, |
|
118 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_All_Parameters }, |
|
119 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Communication_Parameters }, |
|
120 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Application_Parameters }, |
|
121 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1010_Save_Manufacturer_Parameters } |
|
122 }; |
|
123 |
|
124 /* index 0x1011 : Restore Default Parameters. */ |
|
125 UNS8 TestSlave_highestSubIndex_obj1011 = 4; // number of subindex - 1 |
|
126 UNS32 TestSlave_obj1011_Restore_All_Default_Parameters = 0x0; // 0 |
|
127 UNS32 TestSlave_obj1011_Restore_Communication_Default_Parameters = 0x0; // 0 |
|
128 UNS32 TestSlave_obj1011_Restore_Application_Default_Parameters = 0x0; // 0 |
|
129 UNS32 TestSlave_obj1011_Restore_Manufacturer_Default_Parameters = 0x0; // 0 |
|
130 ODCallback_t TestSlave_Index1011_callbacks[] = |
|
131 { |
|
132 NULL, |
|
133 NULL, |
|
134 NULL, |
|
135 NULL, |
|
136 NULL, |
|
137 }; |
|
138 subindex TestSlave_Index1011[] = |
|
139 { |
|
140 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1011 }, |
|
141 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_All_Default_Parameters }, |
|
142 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Communication_Default_Parameters }, |
|
143 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Application_Default_Parameters }, |
|
144 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1011_Restore_Manufacturer_Default_Parameters } |
99 }; |
145 }; |
100 |
146 |
101 /* index 0x1016 : Consumer Heartbeat Time */ |
147 /* index 0x1016 : Consumer Heartbeat Time */ |
102 UNS8 TestSlave_highestSubIndex_obj1016 = 0; |
148 UNS8 TestSlave_highestSubIndex_obj1016 = 0; |
103 UNS32 TestSlave_obj1016[0]; |
149 UNS32 TestSlave_obj1016[0]; |
104 subindex TestSlave_Index1016[0]; |
150 subindex TestSlave_Index1016[0]; |
105 |
151 |
106 /* index 0x1017 : Producer Heartbeat Time. */ |
152 /* index 0x1017 : Producer Heartbeat Time. */ |
107 UNS16 TestSlave_obj1017 = 0x3E8; |
153 UNS16 TestSlave_obj1017 = 0x3E8; // 1000 |
108 subindex TestSlave_Index1017[] = |
154 subindex TestSlave_Index1017[] = |
109 { |
155 { |
110 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 } |
156 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1017 } |
111 }; |
157 }; |
112 |
158 |
113 /* index 0x1018 : Identity. */ |
159 /* index 0x1018 : Identity. */ |
114 UNS8 TestSlave_highestSubIndex_obj1018 = 4; // number of subindex - 1 |
160 UNS8 TestSlave_highestSubIndex_obj1018 = 4; // number of subindex - 1 |
115 UNS32 TestSlave_obj1018_Vendor_ID = 0x0; |
161 UNS32 TestSlave_obj1018_Vendor_ID = 0x0; // 0 |
116 UNS32 TestSlave_obj1018_Product_Code = 0x0; |
162 UNS32 TestSlave_obj1018_Product_Code = 0x0; // 0 |
117 UNS32 TestSlave_obj1018_Revision_Number = 0x0; |
163 UNS32 TestSlave_obj1018_Revision_Number = 0x0; // 0 |
118 UNS32 TestSlave_obj1018_Serial_Number = 0x0; |
164 UNS32 TestSlave_obj1018_Serial_Number = 0x0; // 0 |
119 subindex TestSlave_Index1018[] = |
165 subindex TestSlave_Index1018[] = |
120 { |
166 { |
121 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 }, |
167 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1018 }, |
122 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID }, |
168 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Vendor_ID }, |
123 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code }, |
169 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Product_Code }, |
125 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number } |
171 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1018_Serial_Number } |
126 }; |
172 }; |
127 |
173 |
128 /* index 0x1200 : Server SDO Parameter. */ |
174 /* index 0x1200 : Server SDO Parameter. */ |
129 UNS8 TestSlave_highestSubIndex_obj1200 = 2; // number of subindex - 1 |
175 UNS8 TestSlave_highestSubIndex_obj1200 = 2; // number of subindex - 1 |
130 UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; |
176 UNS32 TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO = 0x601; // 1537 |
131 UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; |
177 UNS32 TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO = 0x581; // 1409 |
132 subindex TestSlave_Index1200[] = |
178 subindex TestSlave_Index1200[] = |
133 { |
179 { |
134 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 }, |
180 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1200 }, |
135 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, |
181 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Client_to_Server_Receive_SDO }, |
136 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } |
182 { RO, uint32, sizeof (UNS32), (void*)&TestSlave_obj1200_COB_ID_Server_to_Client_Transmit_SDO } |
137 }; |
183 }; |
138 |
184 |
139 /* index 0x1800 : Transmit PDO 1 Parameter. */ |
185 /* index 0x1800 : Transmit PDO 1 Parameter. */ |
140 UNS8 TestSlave_highestSubIndex_obj1800 = 5; // number of subindex - 1 |
186 UNS8 TestSlave_highestSubIndex_obj1800 = 5; // number of subindex - 1 |
141 UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; |
187 UNS32 TestSlave_obj1800_COB_ID_used_by_PDO = 0x182; // 386 |
142 UNS8 TestSlave_obj1800_Transmission_Type = 0x1; |
188 UNS8 TestSlave_obj1800_Transmission_Type = 0x1; // 1 |
143 UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; |
189 UNS16 TestSlave_obj1800_Inhibit_Time = 0x0; // 0 |
144 UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; |
190 UNS16 TestSlave_obj1800_Compatibility_Entry = 0x0; // 0 |
145 UNS16 TestSlave_obj1800_Event_Timer = 0x0; |
191 UNS16 TestSlave_obj1800_Event_Timer = 0x0; // 0 |
146 subindex TestSlave_Index1800[] = |
192 subindex TestSlave_Index1800[] = |
147 { |
193 { |
148 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 }, |
194 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1800 }, |
149 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO }, |
195 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1800_COB_ID_used_by_PDO }, |
150 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type }, |
196 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1800_Transmission_Type }, |
153 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer } |
199 { RW, uint16, sizeof (UNS16), (void*)&TestSlave_obj1800_Event_Timer } |
154 }; |
200 }; |
155 |
201 |
156 /* index 0x1801 : Transmit PDO 2 Parameter. */ |
202 /* index 0x1801 : Transmit PDO 2 Parameter. */ |
157 UNS8 TestSlave_highestSubIndex_obj1801 = 5; // number of subindex - 1 |
203 UNS8 TestSlave_highestSubIndex_obj1801 = 5; // number of subindex - 1 |
158 UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; |
204 UNS32 TestSlave_obj1801_COB_ID_used_by_PDO = 0x282; // 642 |
159 UNS8 TestSlave_obj1801_Transmission_Type = 0x1; |
205 UNS8 TestSlave_obj1801_Transmission_Type = 0x1; // 1 |
160 UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; |
206 UNS16 TestSlave_obj1801_Inhibit_Time = 0x0; // 0 |
161 UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; |
207 UNS16 TestSlave_obj1801_Compatibility_Entry = 0x0; // 0 |
162 UNS16 TestSlave_obj1801_Event_Timer = 0x0; |
208 UNS16 TestSlave_obj1801_Event_Timer = 0x0; // 0 |
163 subindex TestSlave_Index1801[] = |
209 subindex TestSlave_Index1801[] = |
164 { |
210 { |
165 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 }, |
211 { RO, uint8, sizeof (UNS8), (void*)&TestSlave_highestSubIndex_obj1801 }, |
166 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO }, |
212 { RW, uint32, sizeof (UNS32), (void*)&TestSlave_obj1801_COB_ID_used_by_PDO }, |
167 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type }, |
213 { RW, uint8, sizeof (UNS8), (void*)&TestSlave_obj1801_Transmission_Type }, |
226 { |
272 { |
227 { (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000}, |
273 { (subindex*)TestSlave_Index1000,sizeof(TestSlave_Index1000)/sizeof(TestSlave_Index1000[0]), 0x1000}, |
228 { (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001}, |
274 { (subindex*)TestSlave_Index1001,sizeof(TestSlave_Index1001)/sizeof(TestSlave_Index1001[0]), 0x1001}, |
229 { (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005}, |
275 { (subindex*)TestSlave_Index1005,sizeof(TestSlave_Index1005)/sizeof(TestSlave_Index1005[0]), 0x1005}, |
230 { (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006}, |
276 { (subindex*)TestSlave_Index1006,sizeof(TestSlave_Index1006)/sizeof(TestSlave_Index1006[0]), 0x1006}, |
|
277 { (subindex*)TestSlave_Index1010,sizeof(TestSlave_Index1010)/sizeof(TestSlave_Index1010[0]), 0x1010}, |
|
278 { (subindex*)TestSlave_Index1011,sizeof(TestSlave_Index1011)/sizeof(TestSlave_Index1011[0]), 0x1011}, |
231 { (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017}, |
279 { (subindex*)TestSlave_Index1017,sizeof(TestSlave_Index1017)/sizeof(TestSlave_Index1017[0]), 0x1017}, |
232 { (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018}, |
280 { (subindex*)TestSlave_Index1018,sizeof(TestSlave_Index1018)/sizeof(TestSlave_Index1018[0]), 0x1018}, |
233 { (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200}, |
281 { (subindex*)TestSlave_Index1200,sizeof(TestSlave_Index1200)/sizeof(TestSlave_Index1200[0]), 0x1200}, |
234 { (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800}, |
282 { (subindex*)TestSlave_Index1800,sizeof(TestSlave_Index1800)/sizeof(TestSlave_Index1800[0]), 0x1800}, |
235 { (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801}, |
283 { (subindex*)TestSlave_Index1801,sizeof(TestSlave_Index1801)/sizeof(TestSlave_Index1801[0]), 0x1801}, |
242 }; |
290 }; |
243 |
291 |
244 const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) |
292 const indextable * TestSlave_scanIndexOD (UNS16 wIndex, UNS32 * errorCode, ODCallback_t **callbacks) |
245 { |
293 { |
246 int i; |
294 int i; |
|
295 *callbacks = NULL; |
247 switch(wIndex){ |
296 switch(wIndex){ |
248 case 0x1000: i = 0; *callbacks = NULL; break; |
297 case 0x1000: i = 0;break; |
249 case 0x1001: i = 1; *callbacks = NULL; break; |
298 case 0x1001: i = 1;break; |
250 case 0x1005: i = 2; *callbacks = TestSlave_Index1005_callbacks; break; |
299 case 0x1005: i = 2;*callbacks = TestSlave_Index1005_callbacks; break; |
251 case 0x1006: i = 3; *callbacks = TestSlave_Index1006_callbacks; break; |
300 case 0x1006: i = 3;*callbacks = TestSlave_Index1006_callbacks; break; |
252 case 0x1017: i = 4; *callbacks = NULL; break; |
301 case 0x1010: i = 4;*callbacks = TestSlave_Index1010_callbacks; break; |
253 case 0x1018: i = 5; *callbacks = NULL; break; |
302 case 0x1011: i = 5;*callbacks = TestSlave_Index1011_callbacks; break; |
254 case 0x1200: i = 6; *callbacks = NULL; break; |
303 case 0x1017: i = 6;break; |
255 case 0x1800: i = 7; *callbacks = NULL; break; |
304 case 0x1018: i = 7;break; |
256 case 0x1801: i = 8; *callbacks = NULL; break; |
305 case 0x1200: i = 8;break; |
257 case 0x1A00: i = 9; *callbacks = NULL; break; |
306 case 0x1800: i = 9;break; |
258 case 0x1A01: i = 10; *callbacks = NULL; break; |
307 case 0x1801: i = 10;break; |
259 case 0x2000: i = 11; *callbacks = NULL; break; |
308 case 0x1A00: i = 11;break; |
260 case 0x2001: i = 12; *callbacks = NULL; break; |
309 case 0x1A01: i = 12;break; |
261 case 0x2002: i = 13; *callbacks = NULL; break; |
310 case 0x2000: i = 13;break; |
262 case 0x2003: i = 14; *callbacks = NULL; break; |
311 case 0x2001: i = 14;break; |
|
312 case 0x2002: i = 15;break; |
|
313 case 0x2003: i = 16;break; |
263 default: |
314 default: |
264 *errorCode = OD_NO_SUCH_OBJECT; |
315 *errorCode = OD_NO_SUCH_OBJECT; |
265 return NULL; |
316 return NULL; |
266 } |
317 } |
267 *errorCode = OD_SUCCESSFUL; |
318 *errorCode = OD_SUCCESSFUL; |