1 /* 2 * CANopen Object Dictionary. 3 * 4 * This file was automatically generated with CANopenNode Object 5 * Dictionary Editor. DON'T EDIT THIS FILE MANUALLY !!!! 6 * Object Dictionary Editor is currently an older, but functional web 7 * application. For more info see See 'Object_Dictionary_Editor/about.html' in 8 * <http://sourceforge.net/p/canopennode/code_complete/ci/master/tree/> 9 * For more information on CANopen Object Dictionary see <CO_SDO.h>. 10 * 11 * @file CO_OD.h 12 * @author Janez Paternoster 13 * @copyright 2010 - 2020 Janez Paternoster 14 * 15 * This file is part of CANopenNode, an opensource CANopen Stack. 16 * Project home page is <https://github.com/CANopenNode/CANopenNode>. 17 * For more information on CANopen see <http://www.can-cia.org/>. 18 * 19 * Licensed under the Apache License, Version 2.0 (the "License"); 20 * you may not use this file except in compliance with the License. 21 * You may obtain a copy of the License at 22 * 23 * http://www.apache.org/licenses/LICENSE-2.0 24 * 25 * Unless required by applicable law or agreed to in writing, software 26 * distributed under the License is distributed on an "AS IS" BASIS, 27 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 28 * See the License for the specific language governing permissions and 29 * limitations under the License. 30 */ 31 32 33 #ifndef CO_OD_H 34 #define CO_OD_H 35 36 37 /******************************************************************************* 38 CANopen DATA DYPES 39 *******************************************************************************/ 40 typedef uint8_t UNSIGNED8; 41 typedef uint16_t UNSIGNED16; 42 typedef uint32_t UNSIGNED32; 43 typedef uint64_t UNSIGNED64; 44 typedef int8_t INTEGER8; 45 typedef int16_t INTEGER16; 46 typedef int32_t INTEGER32; 47 typedef int64_t INTEGER64; 48 typedef float32_t REAL32; 49 typedef float64_t REAL64; 50 typedef char_t VISIBLE_STRING; 51 typedef oChar_t OCTET_STRING; 52 typedef domain_t DOMAIN; 53 54 55 /******************************************************************************* 56 FILE INFO: 57 FileName: IO Example 58 FileVersion: - 59 CreationTime: 17:24:43 60 CreationDate: 2016-03-25 61 CreatedBy: JP 62 *******************************************************************************/ 63 64 65 /******************************************************************************* 66 DEVICE INFO: 67 VendorName: CANopenNode 68 VendorNumber: 0 69 ProductName: CANopenNode 70 ProductNumber: 0 71 *******************************************************************************/ 72 73 74 /******************************************************************************* 75 FEATURES 76 *******************************************************************************/ 77 #define CO_NO_SYNC 1 //Associated objects: 1005, 1006, 1007, 2103, 2104 78 #define CO_NO_EMERGENCY 1 //Associated objects: 1014, 1015 79 #define CO_NO_SDO_SERVER 1 //Associated objects: 1200 80 #define CO_NO_SDO_CLIENT 0 81 #define CO_NO_RPDO 4 //Associated objects: 1400, 1401, 1402, 1403, 1600, 1601, 1602, 1603 82 #define CO_NO_TPDO 4 //Associated objects: 1800, 1801, 1802, 1803, 1A00, 1A01, 1A02, 1A03 83 #define CO_NO_NMT_MASTER 0 84 #define CO_NO_TRACE 2 //Associated objects: 2301, 2302, 2400, 2401, 2402 85 86 87 /******************************************************************************* 88 OBJECT DICTIONARY 89 *******************************************************************************/ 90 #define CO_OD_NoOfElements 60 91 92 93 /******************************************************************************* 94 TYPE DEFINITIONS FOR RECORDS 95 *******************************************************************************/ 96 /*1018 */ typedef struct{ 97 UNSIGNED8 maxSubIndex; 98 UNSIGNED32 vendorID; 99 UNSIGNED32 productCode; 100 UNSIGNED32 revisionNumber; 101 UNSIGNED32 serialNumber; 102 } OD_identity_t; 103 104 /*1200[1] */ typedef struct{ 105 UNSIGNED8 maxSubIndex; 106 UNSIGNED32 COB_IDClientToServer; 107 UNSIGNED32 COB_IDServerToClient; 108 } OD_SDOServerParameter_t; 109 110 /*1400[4] */ typedef struct{ 111 UNSIGNED8 maxSubIndex; 112 UNSIGNED32 COB_IDUsedByRPDO; 113 UNSIGNED8 transmissionType; 114 } OD_RPDOCommunicationParameter_t; 115 116 /*1600[4] */ typedef struct{ 117 UNSIGNED8 numberOfMappedObjects; 118 UNSIGNED32 mappedObject1; 119 UNSIGNED32 mappedObject2; 120 UNSIGNED32 mappedObject3; 121 UNSIGNED32 mappedObject4; 122 UNSIGNED32 mappedObject5; 123 UNSIGNED32 mappedObject6; 124 UNSIGNED32 mappedObject7; 125 UNSIGNED32 mappedObject8; 126 } OD_RPDOMappingParameter_t; 127 128 /*1800[4] */ typedef struct{ 129 UNSIGNED8 maxSubIndex; 130 UNSIGNED32 COB_IDUsedByTPDO; 131 UNSIGNED8 transmissionType; 132 UNSIGNED16 inhibitTime; 133 UNSIGNED8 compatibilityEntry; 134 UNSIGNED16 eventTimer; 135 UNSIGNED8 SYNCStartValue; 136 } OD_TPDOCommunicationParameter_t; 137 138 /*1A00[4] */ typedef struct{ 139 UNSIGNED8 numberOfMappedObjects; 140 UNSIGNED32 mappedObject1; 141 UNSIGNED32 mappedObject2; 142 UNSIGNED32 mappedObject3; 143 UNSIGNED32 mappedObject4; 144 UNSIGNED32 mappedObject5; 145 UNSIGNED32 mappedObject6; 146 UNSIGNED32 mappedObject7; 147 UNSIGNED32 mappedObject8; 148 } OD_TPDOMappingParameter_t; 149 150 /*2120 */ typedef struct{ 151 UNSIGNED8 maxSubIndex; 152 INTEGER64 I64; 153 UNSIGNED64 U64; 154 REAL32 R32; 155 REAL64 R64; 156 DOMAIN domain; 157 } OD_testVar_t; 158 159 /*2130 */ typedef struct{ 160 UNSIGNED8 maxSubIndex; 161 VISIBLE_STRING string[30]; 162 UNSIGNED64 epochTimeBaseMs; 163 UNSIGNED32 epochTimeOffsetMs; 164 } OD_time_t; 165 166 /*2301[2] */ typedef struct{ 167 UNSIGNED8 maxSubIndex; 168 UNSIGNED32 size; 169 UNSIGNED8 axisNo; 170 VISIBLE_STRING name[30]; 171 VISIBLE_STRING color[20]; 172 UNSIGNED32 map; 173 UNSIGNED8 format; 174 UNSIGNED8 trigger; 175 INTEGER32 threshold; 176 } OD_traceConfig_t; 177 178 /*2401[2] */ typedef struct{ 179 UNSIGNED8 maxSubIndex; 180 UNSIGNED32 size; 181 INTEGER32 value; 182 INTEGER32 min; 183 INTEGER32 max; 184 DOMAIN plot; 185 UNSIGNED32 triggerTime; 186 } OD_trace_t; 187 188 189 /******************************************************************************* 190 STRUCTURES FOR VARIABLES IN DIFFERENT MEMORY LOCATIONS 191 *******************************************************************************/ 192 #define CO_OD_FIRST_LAST_WORD 0x55 //Any value from 0x01 to 0xFE. If changed, EEPROM will be reinitialized. 193 194 /***** Structure for RAM variables ********************************************/ 195 struct sCO_OD_RAM{ 196 UNSIGNED32 FirstWord; 197 198 /*1001 */ UNSIGNED8 errorRegister; 199 /*1002 */ UNSIGNED32 manufacturerStatusRegister; 200 /*1003 */ UNSIGNED32 preDefinedErrorField[8]; 201 /*1010 */ UNSIGNED32 storeParameters[1]; 202 /*1011 */ UNSIGNED32 restoreDefaultParameters[1]; 203 /*2100 */ OCTET_STRING errorStatusBits[10]; 204 /*2103 */ UNSIGNED16 SYNCCounter; 205 /*2104 */ UNSIGNED16 SYNCTime; 206 /*2107 */ UNSIGNED16 performance[5]; 207 /*2108 */ INTEGER16 temperature[1]; 208 /*2109 */ INTEGER16 voltage[1]; 209 /*2110 */ INTEGER32 variableInt32[16]; 210 /*2120 */ OD_testVar_t testVar; 211 /*2130 */ OD_time_t time; 212 /*2400 */ UNSIGNED8 traceEnable; 213 /*2401[2] */ OD_trace_t trace[2]; 214 /*6000 */ UNSIGNED8 readInput8Bit[8]; 215 /*6200 */ UNSIGNED8 writeOutput8Bit[8]; 216 /*6401 */ INTEGER16 readAnalogueInput16Bit[12]; 217 /*6411 */ INTEGER16 writeAnalogueOutput16Bit[8]; 218 219 UNSIGNED32 LastWord; 220 }; 221 222 /***** Structure for EEPROM variables *****************************************/ 223 struct sCO_OD_EEPROM{ 224 UNSIGNED32 FirstWord; 225 226 /*2106 */ UNSIGNED32 powerOnCounter; 227 /*2112 */ INTEGER32 variableNVInt32[16]; 228 229 UNSIGNED32 LastWord; 230 }; 231 232 233 /***** Structure for ROM variables ********************************************/ 234 struct sCO_OD_ROM{ 235 UNSIGNED32 FirstWord; 236 237 /*1000 */ UNSIGNED32 deviceType; 238 /*1005 */ UNSIGNED32 COB_ID_SYNCMessage; 239 /*1006 */ UNSIGNED32 communicationCyclePeriod; 240 /*1007 */ UNSIGNED32 synchronousWindowLength; 241 /*1008 */ VISIBLE_STRING manufacturerDeviceName[11]; 242 /*1009 */ VISIBLE_STRING manufacturerHardwareVersion[4]; 243 /*100A */ VISIBLE_STRING manufacturerSoftwareVersion[4]; 244 /*1014 */ UNSIGNED32 COB_ID_EMCY; 245 /*1015 */ UNSIGNED16 inhibitTimeEMCY; 246 /*1016 */ UNSIGNED32 consumerHeartbeatTime[4]; 247 /*1017 */ UNSIGNED16 producerHeartbeatTime; 248 /*1018 */ OD_identity_t identity; 249 /*1019 */ UNSIGNED8 synchronousCounterOverflowValue; 250 /*1029 */ UNSIGNED8 errorBehavior[6]; 251 /*1200[1] */ OD_SDOServerParameter_t SDOServerParameter[1]; 252 /*1400[4] */ OD_RPDOCommunicationParameter_t RPDOCommunicationParameter[4]; 253 /*1600[4] */ OD_RPDOMappingParameter_t RPDOMappingParameter[4]; 254 /*1800[4] */ OD_TPDOCommunicationParameter_t TPDOCommunicationParameter[4]; 255 /*1A00[4] */ OD_TPDOMappingParameter_t TPDOMappingParameter[4]; 256 /*1F80 */ UNSIGNED32 NMTStartup; 257 /*2101 */ UNSIGNED8 CANNodeID; 258 /*2102 */ UNSIGNED16 CANBitRate; 259 /*2111 */ INTEGER32 variableROMInt32[16]; 260 /*2301[2] */ OD_traceConfig_t traceConfig[2]; 261 262 UNSIGNED32 LastWord; 263 }; 264 265 266 /***** Declaration of Object Dictionary variables *****************************/ 267 extern struct sCO_OD_RAM CO_OD_RAM; 268 269 extern struct sCO_OD_EEPROM CO_OD_EEPROM; 270 271 extern struct sCO_OD_ROM CO_OD_ROM; 272 273 274 /******************************************************************************* 275 ALIASES FOR OBJECT DICTIONARY VARIABLES 276 *******************************************************************************/ 277 /*1000, Data Type: UNSIGNED32 */ 278 #define OD_deviceType CO_OD_ROM.deviceType 279 280 /*1001, Data Type: UNSIGNED8 */ 281 #define OD_errorRegister CO_OD_RAM.errorRegister 282 283 /*1002, Data Type: UNSIGNED32 */ 284 #define OD_manufacturerStatusRegister CO_OD_RAM.manufacturerStatusRegister 285 286 /*1003, Data Type: UNSIGNED32, Array[8] */ 287 #define OD_preDefinedErrorField CO_OD_RAM.preDefinedErrorField 288 #define ODL_preDefinedErrorField_arrayLength 8 289 290 /*1005, Data Type: UNSIGNED32 */ 291 #define OD_COB_ID_SYNCMessage CO_OD_ROM.COB_ID_SYNCMessage 292 293 /*1006, Data Type: UNSIGNED32 */ 294 #define OD_communicationCyclePeriod CO_OD_ROM.communicationCyclePeriod 295 296 /*1007, Data Type: UNSIGNED32 */ 297 #define OD_synchronousWindowLength CO_OD_ROM.synchronousWindowLength 298 299 /*1008, Data Type: VISIBLE_STRING, Array[11] */ 300 #define OD_manufacturerDeviceName CO_OD_ROM.manufacturerDeviceName 301 #define ODL_manufacturerDeviceName_stringLength 11 302 303 /*1009, Data Type: VISIBLE_STRING, Array[4] */ 304 #define OD_manufacturerHardwareVersion CO_OD_ROM.manufacturerHardwareVersion 305 #define ODL_manufacturerHardwareVersion_stringLength 4 306 307 /*100A, Data Type: VISIBLE_STRING, Array[4] */ 308 #define OD_manufacturerSoftwareVersion CO_OD_ROM.manufacturerSoftwareVersion 309 #define ODL_manufacturerSoftwareVersion_stringLength 4 310 311 /*1010, Data Type: UNSIGNED32, Array[1] */ 312 #define OD_storeParameters CO_OD_RAM.storeParameters 313 #define ODL_storeParameters_arrayLength 1 314 #define ODA_storeParameters_saveAllParameters 0 315 316 /*1011, Data Type: UNSIGNED32, Array[1] */ 317 #define OD_restoreDefaultParameters CO_OD_RAM.restoreDefaultParameters 318 #define ODL_restoreDefaultParameters_arrayLength 1 319 #define ODA_restoreDefaultParameters_restoreAllDefaultParameters 0 320 321 /*1014, Data Type: UNSIGNED32 */ 322 #define OD_COB_ID_EMCY CO_OD_ROM.COB_ID_EMCY 323 324 /*1015, Data Type: UNSIGNED16 */ 325 #define OD_inhibitTimeEMCY CO_OD_ROM.inhibitTimeEMCY 326 327 /*1016, Data Type: UNSIGNED32, Array[4] */ 328 #define OD_consumerHeartbeatTime CO_OD_ROM.consumerHeartbeatTime 329 #define ODL_consumerHeartbeatTime_arrayLength 4 330 331 /*1017, Data Type: UNSIGNED16 */ 332 #define OD_producerHeartbeatTime CO_OD_ROM.producerHeartbeatTime 333 334 /*1018, Data Type: OD_identity_t */ 335 #define OD_identity CO_OD_ROM.identity 336 337 /*1019, Data Type: UNSIGNED8 */ 338 #define OD_synchronousCounterOverflowValue CO_OD_ROM.synchronousCounterOverflowValue 339 340 /*1029, Data Type: UNSIGNED8, Array[6] */ 341 #define OD_errorBehavior CO_OD_ROM.errorBehavior 342 #define ODL_errorBehavior_arrayLength 6 343 #define ODA_errorBehavior_communication 0 344 #define ODA_errorBehavior_communicationOther 1 345 #define ODA_errorBehavior_communicationPassive 2 346 #define ODA_errorBehavior_generic 3 347 #define ODA_errorBehavior_deviceProfile 4 348 #define ODA_errorBehavior_manufacturerSpecific 5 349 350 /*1200[1], Data Type: OD_SDOServerParameter_t, Array[1] */ 351 #define OD_SDOServerParameter CO_OD_ROM.SDOServerParameter 352 353 /*1400[4], Data Type: OD_RPDOCommunicationParameter_t, Array[4] */ 354 #define OD_RPDOCommunicationParameter CO_OD_ROM.RPDOCommunicationParameter 355 356 /*1600[4], Data Type: OD_RPDOMappingParameter_t, Array[4] */ 357 #define OD_RPDOMappingParameter CO_OD_ROM.RPDOMappingParameter 358 359 /*1800[4], Data Type: OD_TPDOCommunicationParameter_t, Array[4] */ 360 #define OD_TPDOCommunicationParameter CO_OD_ROM.TPDOCommunicationParameter 361 362 /*1A00[4], Data Type: OD_TPDOMappingParameter_t, Array[4] */ 363 #define OD_TPDOMappingParameter CO_OD_ROM.TPDOMappingParameter 364 365 /*1F80, Data Type: UNSIGNED32 */ 366 #define OD_NMTStartup CO_OD_ROM.NMTStartup 367 368 /*2100, Data Type: OCTET_STRING, Array[10] */ 369 #define OD_errorStatusBits CO_OD_RAM.errorStatusBits 370 #define ODL_errorStatusBits_stringLength 10 371 372 /*2101, Data Type: UNSIGNED8 */ 373 #define OD_CANNodeID CO_OD_ROM.CANNodeID 374 375 /*2102, Data Type: UNSIGNED16 */ 376 #define OD_CANBitRate CO_OD_ROM.CANBitRate 377 378 /*2103, Data Type: UNSIGNED16 */ 379 #define OD_SYNCCounter CO_OD_RAM.SYNCCounter 380 381 /*2104, Data Type: UNSIGNED16 */ 382 #define OD_SYNCTime CO_OD_RAM.SYNCTime 383 384 /*2106, Data Type: UNSIGNED32 */ 385 #define OD_powerOnCounter CO_OD_EEPROM.powerOnCounter 386 387 /*2107, Data Type: UNSIGNED16, Array[5] */ 388 #define OD_performance CO_OD_RAM.performance 389 #define ODL_performance_arrayLength 5 390 #define ODA_performance_cyclesPerSecond 0 391 #define ODA_performance_timerCycleTime 1 392 #define ODA_performance_timerCycleMaxTime 2 393 #define ODA_performance_mainCycleTime 3 394 #define ODA_performance_mainCycleMaxTime 4 395 396 /*2108, Data Type: INTEGER16, Array[1] */ 397 #define OD_temperature CO_OD_RAM.temperature 398 #define ODL_temperature_arrayLength 1 399 #define ODA_temperature_mainPCB 0 400 401 /*2109, Data Type: INTEGER16, Array[1] */ 402 #define OD_voltage CO_OD_RAM.voltage 403 #define ODL_voltage_arrayLength 1 404 #define ODA_voltage_mainPCBSupply 0 405 406 /*2110, Data Type: INTEGER32, Array[16] */ 407 #define OD_variableInt32 CO_OD_RAM.variableInt32 408 #define ODL_variableInt32_arrayLength 16 409 410 /*2111, Data Type: INTEGER32, Array[16] */ 411 #define OD_variableROMInt32 CO_OD_ROM.variableROMInt32 412 #define ODL_variableROMInt32_arrayLength 16 413 414 /*2112, Data Type: INTEGER32, Array[16] */ 415 #define OD_variableNVInt32 CO_OD_EEPROM.variableNVInt32 416 #define ODL_variableNVInt32_arrayLength 16 417 418 /*2120, Data Type: OD_testVar_t */ 419 #define OD_testVar CO_OD_RAM.testVar 420 421 /*2130, Data Type: OD_time_t */ 422 #define OD_time CO_OD_RAM.time 423 424 /*2301[2], Data Type: OD_traceConfig_t, Array[2] */ 425 #define OD_traceConfig CO_OD_ROM.traceConfig 426 427 /*2400, Data Type: UNSIGNED8 */ 428 #define OD_traceEnable CO_OD_RAM.traceEnable 429 430 /*2401[2], Data Type: OD_trace_t, Array[2] */ 431 #define OD_trace CO_OD_RAM.trace 432 433 /*6000, Data Type: UNSIGNED8, Array[8] */ 434 #define OD_readInput8Bit CO_OD_RAM.readInput8Bit 435 #define ODL_readInput8Bit_arrayLength 8 436 437 /*6200, Data Type: UNSIGNED8, Array[8] */ 438 #define OD_writeOutput8Bit CO_OD_RAM.writeOutput8Bit 439 #define ODL_writeOutput8Bit_arrayLength 8 440 441 /*6401, Data Type: INTEGER16, Array[12] */ 442 #define OD_readAnalogueInput16Bit CO_OD_RAM.readAnalogueInput16Bit 443 #define ODL_readAnalogueInput16Bit_arrayLength 12 444 445 /*6411, Data Type: INTEGER16, Array[8] */ 446 #define OD_writeAnalogueOutput16Bit CO_OD_RAM.writeAnalogueOutput16Bit 447 #define ODL_writeAnalogueOutput16Bit_arrayLength 8 448 449 450 #endif 451 452