00001 /*************************************************************************** 00002 objdict.h - description 00003 ------------------- 00004 begin : Fri May 17 2002 00005 copyright : (C) 2002 by Raphael Zulliger 00006 email : zulli@hsr.ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This library is Copyright (c) by Raphael Zulliger <zulli@gmx.net>. * 00012 * It is licensed under the GNU Library General Public License (LGPL). * 00013 * * 00014 ***************************************************************************/ 00015 00016 00029 #ifndef __objdict_h__ 00030 #define __objdict_h__ 00031 00032 #include <def.h> 00033 00034 00039 #define DeclareIndexTableEntry(entryname) { (subindex*)entryname,sizeof(entryname)/sizeof(entryname[0])} 00040 00041 00047 #define boolean 0x01 00048 #define int8 0x02 00049 #define int16 0x03 00050 #define int32 0x04 00051 #define uint8 0x05 00052 #define uint16 0x06 00053 #define uint32 0x07 00054 #define real32 0x08 00055 #define visible_string 0x09 00056 #define octet_string 0x0A 00057 #define unicode_string 0x0B 00058 #define time_of_day 0x0C 00059 #define time_difference 0x0D 00060 00061 #define domain 0x0F 00062 #define int24 0x10 00063 #define real64 0x11 00064 #define int40 0x12 00065 #define int48 0x13 00066 #define int56 0x14 00067 #define int64 0x15 00068 #define uint24 0x16 00069 00070 #define uint40 0x18 00071 #define uint48 0x19 00072 #define uint56 0x1A 00073 #define uint64 0x1B 00074 00075 #define pdo_communication_parameter 0x20 00076 #define pdo_mapping 0x21 00077 #define sdo_parameter 0x22 00078 #define identity 0x23 00079 00080 00088 #define INTEGER8 00089 #define INTEGER16 00090 #define INTEGER32 00091 #define UNSIGNED8 unsigned char 00092 #define UNSIGNED16 unsigned short 00093 #define UNSIGNED32 unsigned long 00094 #define REAL32 00095 #define VISIBLE_STRING 00096 #define OCTET_STRING 00097 #define UNICODE_STRING 00098 #define TIME_OF_DAY 00099 #define TIME_DIFFERENCE 00100 #define INTEGER24 00101 #define REAL64 00102 #define INTEGER40 00103 #define INTEGER48 00104 #define INTEGER56 00105 #define INTEGER64 00106 #define UNSIGNED24 00107 #define UNSIGNED40 00108 #define UNSINGED48 00109 #define UNSINGED56 00110 #define UNSIGNED64 00111 00119 typedef struct td_s_pdo_communication_parameter // Index: 0x20 00120 { 00123 UNSIGNED8 count; 00126 UNSIGNED32 cob_id; 00129 UNSIGNED8 type; 00132 UNSIGNED16 inhibit_time; 00135 UNSIGNED8 reserved; 00138 UNSIGNED16 event_timer; 00139 } s_pdo_communication_parameter; 00140 00143 #define COUNT_OF_PDO_MAPPING_PARAMETER 4 00144 00148 typedef struct td_s_pdo_mapping_parameter // Index: 0x21 00149 { 00152 UNSIGNED8 count; 00155 UNSIGNED32 object[COUNT_OF_PDO_MAPPING_PARAMETER]; 00156 } s_pdo_mapping_parameter; 00157 00158 00159 00162 typedef struct td_s_sdo_parameter // Index: 0x22 00163 { 00166 UNSIGNED8 count; 00169 UNSIGNED32 cob_id_client; 00172 UNSIGNED32 cob_id_server; 00175 UNSIGNED8 node_id; 00176 } s_sdo_parameter; 00177 00178 00182 typedef struct td_s_identity // Index: 0x23 00183 { 00186 UNSIGNED8 count; 00189 UNSIGNED32 vendor_id; 00192 UNSIGNED32 product_code; 00195 UNSIGNED32 revision_number; 00198 UNSIGNED32 serial_number; 00199 } s_identity; 00200 00201 00208 enum e_accessAttribute { RW, WO, RO, CONST }; 00209 00215 enum objectDefinition { DOMAIN=2, DEFTYPE=5, DEFSTRUCT=6, VAR=7, ARRAY=8, RECORD=9 }; 00216 00217 00218 00222 typedef struct td_subindex 00223 { 00224 enum e_accessAttribute bAccessType; // Access type (RO, RW, ...) 00225 BYTE bDataType; // Defines of what datatype the entry is 00226 DWORD size; // The size (in Byte) of the variable 00227 void* pObject; // This is the pointer of the Variable 00228 } subindex; 00229 00230 00233 typedef struct td_indextable 00234 { 00235 subindex* pSubindex; // Pointer to the subindex 00236 UNSIGNED8 bSubCount; // the count of valid entries in for this subindex 00237 // note: this count can differ fCODE the count defined 00238 // in some object dictionary entries (in subindex 0). 00239 // this count here defines how many memory has been 00240 // allocated. this memory does not have to be used. 00241 } indextable; 00242 00243 00253 #define COUNT_OF_HEARTBEAT_CONSUMER 1 00254 00255 00256 00257 00258 00259 00260 /************************************************************************* 00261 * This is the part of the object directory which contains the 00262 * communication profile... 00263 *************************************************************************/ 00264 00268 #define COMM_PROFILE_LAST 0x1018 00269 00273 extern const CODE indextable FAR CommunicationProfileArea[]; 00274 00275 00276 00277 00278 00279 00280 /************************************************************************* 00281 * This is the part of the object directory which contains the 00282 * PDO Parameters 00283 *************************************************************************/ 00284 00288 extern const CODE indextable FAR receivePDOParameter[]; 00289 00295 #define RECEIVE_PDO_LAST 0x1400 00296 00297 00300 #define MAX_COUNT_OF_PDO (RECEIVE_PDO_LAST - 0x13FF) 00301 00305 extern const CODE indextable FAR transmitPDOParameter[]; 00306 00312 #define TRANSMIT_PDO_LAST 0x1800 00313 00314 00315 00316 00317 /************************************************************************* 00318 * This is the part of the object directory which contains the 00319 * PDO Mapping parameters 00320 *************************************************************************/ 00321 00326 #define MAPPING_PARAMETER_COUNT 8 00327 00331 extern const CODE indextable FAR RxPDOMappingTable[ ]; 00332 00336 #define RECEIVE_PDO_MAPPING_LAST 0x1600 00337 00341 extern const CODE indextable FAR TxPDOMappingTable[ ]; 00342 00346 #define TRANSMIT_PDO_MAPPING_LAST 0x1A00 00347 00348 00349 00350 00351 /************************************************************************* 00352 * DS-401: digital&analog input/output device 00353 *************************************************************************/ 00354 00359 extern const CODE indextable FAR digitalInputTable[]; 00360 00363 #define COUNT_OF_DIGITAL_INPUT 3 00364 00368 extern const CODE indextable FAR digitalOutputTable[]; 00369 00373 #define COUNT_OF_DIGITAL_OUTPUT 1 00374 00375 00376 #endif // __objdict_h__