Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

objdict.h File Reference

Instanciates all needed variables and defining the needed defines for the object dictionary. More...

#include <def.h>

Go to the source code of this file.

Data Structures

struct  td_indextable
struct  td_s_identity
struct  td_s_pdo_communication_parameter
struct  td_s_pdo_mapping_parameter
struct  td_s_sdo_parameter
struct  td_subindex

Defines

#define DeclareIndexTableEntry(entryname)   { (subindex*)entryname,sizeof(entryname)/sizeof(entryname[0])}
#define boolean   0x01
#define int8   0x02
#define int16   0x03
#define int32   0x04
#define uint8   0x05
#define uint16   0x06
#define uint32   0x07
#define real32   0x08
#define visible_string   0x09
#define octet_string   0x0A
#define unicode_string   0x0B
#define time_of_day   0x0C
#define time_difference   0x0D
#define domain   0x0F
#define int24   0x10
#define real64   0x11
#define int40   0x12
#define int48   0x13
#define int56   0x14
#define int64   0x15
#define uint24   0x16
#define uint40   0x18
#define uint48   0x19
#define uint56   0x1A
#define uint64   0x1B
#define pdo_communication_parameter   0x20
#define pdo_mapping   0x21
#define sdo_parameter   0x22
#define identity   0x23
#define INTEGER8
#define INTEGER16
#define INTEGER32
#define UNSIGNED8   unsigned char
#define UNSIGNED16   unsigned short
#define UNSIGNED32   unsigned long
#define REAL32
#define VISIBLE_STRING
#define OCTET_STRING
#define UNICODE_STRING
#define TIME_OF_DAY
#define TIME_DIFFERENCE
#define INTEGER24
#define REAL64
#define INTEGER40
#define INTEGER48
#define INTEGER56
#define INTEGER64
#define UNSIGNED24
#define UNSIGNED40
#define UNSINGED48
#define UNSINGED56
#define UNSIGNED64
#define COUNT_OF_PDO_MAPPING_PARAMETER   4
#define COUNT_OF_HEARTBEAT_CONSUMER   1
#define COMM_PROFILE_LAST   0x1018
#define RECEIVE_PDO_LAST   0x1400
#define MAX_COUNT_OF_PDO   (RECEIVE_PDO_LAST - 0x13FF)
#define TRANSMIT_PDO_LAST   0x1800
#define MAPPING_PARAMETER_COUNT   8
#define RECEIVE_PDO_MAPPING_LAST   0x1600
#define TRANSMIT_PDO_MAPPING_LAST   0x1A00
#define COUNT_OF_DIGITAL_INPUT   3
#define COUNT_OF_DIGITAL_OUTPUT   1

Typedefs

typedef td_s_pdo_communication_parameter s_pdo_communication_parameter
typedef td_s_pdo_mapping_parameter s_pdo_mapping_parameter
typedef td_s_sdo_parameter s_sdo_parameter
typedef td_s_identity s_identity
typedef td_subindex subindex
typedef td_indextable indextable

Enumerations

enum  e_accessAttribute { RW, WO, RO, CONST }
enum  objectDefinition {
  DOMAIN = 2, DEFTYPE = 5, DEFSTRUCT = 6, VAR = 7,
  ARRAY = 8, RECORD = 9
}

Variables

const CODE indextable FAR CommunicationProfileArea []
const CODE indextable FAR receivePDOParameter []
const CODE indextable FAR transmitPDOParameter []
const CODE indextable FAR RxPDOMappingTable []
const CODE indextable FAR TxPDOMappingTable []
const CODE indextable FAR digitalInputTable []
const CODE indextable FAR digitalOutputTable []


Detailed Description

Instanciates all needed variables and defining the needed defines for the object dictionary.

In this file you'll find some definitions, variables, ... which are needed to create/accessing the object dictionary. For creating your own CANopen SlaveLib, you have to adapt several variables and defines here.

Warning:
Only the basic entries of an object dictionary are included at the moment.

Define Documentation

#define boolean   0x01
 

this are static defined datatypes taken fCODE the canopen standard. They are located at index 0x0001 to 0x001B. As described in the standard, they are in the object dictionary for definition purpose only. a device does not to support all of this datatypes.

#define COMM_PROFILE_LAST   0x1018
 

defines the last available entry of the communication profile area. Adjust this var, if you have additional enties.

#define COUNT_OF_DIGITAL_INPUT   3
 

The count of digital inputs for which memory has been allocated

#define COUNT_OF_DIGITAL_OUTPUT   1
 

The count of digital outputs for which memory has been allocated

#define COUNT_OF_HEARTBEAT_CONSUMER   1
 

In order to perform lifeguarding of devices, there are two different systems: a device sends itself Heratbeat packages in predefined time-spaces (e.g. every 10 seconds) or the other possibility is, that a node (e.g. the master) "asks" each client about the state of the node (this is called node guarding). Of course also a client can be a heartbeat-consumer (this means it consumes the heartbeats of a device (e.g. it checks, wheter the master is still alive or not). The definition below tells the object dictionary how many heartbeats this node does consumes

#define COUNT_OF_PDO_MAPPING_PARAMETER   4
 

adjust this value, if you need more or less PDO mapping entries. (up to 64 are possible)

#define DeclareIndexTableEntry entryname       { (subindex*)entryname,sizeof(entryname)/sizeof(entryname[0])}
 

This macro helps creating the object dictionary entries. by calling this macro it creates an entry in form of: 7 of entries, pointer to the entry. This macro was sponsered by Edouard Tisserant: thanks!

#define domain   0x0F
 

#define identity   0x23
 

#define int16   0x03
 

#define int24   0x10
 

#define int32   0x04
 

#define int40   0x12
 

#define int48   0x13
 

#define int56   0x14
 

#define int64   0x15
 

#define int8   0x02
 

#define INTEGER16
 

#define INTEGER24
 

#define INTEGER32
 

#define INTEGER40
 

#define INTEGER48
 

#define INTEGER56
 

#define INTEGER64
 

#define INTEGER8
 

real used datatypes for different object dictionary things. I know, some of this definitions are done in def.h, but i thought it would be useful if the datatype names (e.g. UNSIGNED8) has the same names as mentioned in the CANopen standard. so instead of using BYTE, you can use UNSIGNED8, although both are 'unsigned char'... maybe this should be changed...

#define MAPPING_PARAMETER_COUNT   8
 

Each pdo can map up to 64 vars (8 vars per 8bit, and 8 * 1Byte = 64 possibilities "normally" i think you need a maximum of 8 time 1 Byte, so 8 mapping entries should be sufficient. note: for each PDO a PDO-mapping is mandatory!

#define MAX_COUNT_OF_PDO   (RECEIVE_PDO_LAST - 0x13FF)
 

autogenerated value: indicates the count of defined PDOs

#define OCTET_STRING
 

#define octet_string   0x0A
 

#define pdo_communication_parameter   0x20
 

#define pdo_mapping   0x21
 

#define REAL32
 

#define real32   0x08
 

#define REAL64
 

#define real64   0x11
 

#define RECEIVE_PDO_LAST   0x1400
 

This is the last defined entry for pdo-paramters (rx). This means: this is the last entry for which memory has been allocated. Adjust this value if you need more or less entries.

#define RECEIVE_PDO_MAPPING_LAST   0x1600
 

This is the last PDO-Mapping parameter (rx) for which memory has been allocated

#define sdo_parameter   0x22
 

#define TIME_DIFFERENCE
 

#define time_difference   0x0D
 

#define TIME_OF_DAY
 

#define time_of_day   0x0C
 

#define TRANSMIT_PDO_LAST   0x1800
 

This is the last defined entry for pdo-paramters (tx). This means: this is the last entry for which memory has been allocated. Adjust this value if you need more or less entries.

#define TRANSMIT_PDO_MAPPING_LAST   0x1A00
 

This is the last PDO-Mapping parameter (tx) for which memory has been allocated

#define uint16   0x06
 

#define uint24   0x16
 

#define uint32   0x07
 

#define uint40   0x18
 

#define uint48   0x19
 

#define uint56   0x1A
 

#define uint64   0x1B
 

#define uint8   0x05
 

#define UNICODE_STRING
 

#define unicode_string   0x0B
 

#define UNSIGNED16   unsigned short
 

#define UNSIGNED24
 

#define UNSIGNED32   unsigned long
 

#define UNSIGNED40
 

#define UNSIGNED64
 

#define UNSIGNED8   unsigned char
 

#define UNSINGED48
 

#define UNSINGED56
 

#define VISIBLE_STRING
 

#define visible_string   0x09
 


Typedef Documentation

typedef struct td_indextable indextable
 

Struct for creating entries in the communictaion profile

typedef struct td_s_identity s_identity
 

Struct needed for the idendity of a CANopen device. Defined by the CANopen standard

typedef struct td_s_pdo_communication_parameter s_pdo_communication_parameter
 

This is the datatype for the communication parameter of PDOs defined by the CANopen standard

typedef struct td_s_pdo_mapping_parameter s_pdo_mapping_parameter
 

Struct needed for setting up PDO mapping parameter. Defined by the CANopen standard

typedef struct td_s_sdo_parameter s_sdo_parameter
 

Struct needed for SDO parameter. Defined by the CANopen standard

typedef struct td_subindex subindex
 

This are some structs which are neccessary for creating the entries of the object dictionary.


Enumeration Type Documentation

enum e_accessAttribute
 

Each entry of the object dictionary can be READONLY (RO), READ/WRITE (RW), WRITE-ONLY (WO), OR CONSTANT (CONST) At the moment SDO-Transfer is not implemented, and therefore the functions which accesses the object dictionary do not care about this acces-types. Of course this is topic to change!

Enumeration values:
RW 
WO 
RO 
CONST 

enum objectDefinition
 

Each entry of the object dictionary can be a different object. this objects are defined by the CANopen standard. see standard for more information. At the moment the object dictionary does not really care about this different types. this is topic to change!

Enumeration values:
DOMAIN 
DEFTYPE 
DEFSTRUCT 
VAR 
ARRAY 
RECORD 


Variable Documentation

const CODE indextable FAR CommunicationProfileArea[]  
 

now the communication profile entries are grouped together, so they can be accessed in a standardised manner. This could be memory-optimized if the empty entries wouldn't be added, but then the communictaionprofile area must be accessed different (see objacces.c file)

const CODE indextable FAR digitalInputTable[]
 

This variable indexes all entries which are responsible for digital inputs. (input means: a value which is captured by this node and sent to another node e.g. the state of a port is sent to the server )

const CODE indextable FAR digitalOutputTable[]
 

This variable indexes all entries which are responsible for digital outputs.

const CODE indextable FAR receivePDOParameter[]  
 

Create the Receive PDO Parameter area.

const CODE indextable FAR RxPDOMappingTable[ ]
 

This variable indexes all entries neccessary for pdo-mapping for receiving PDOs

const CODE indextable FAR transmitPDOParameter[]  
 

Create the Transmitting PDO Parameter area.

const CODE indextable FAR TxPDOMappingTable[ ]
 

This variable indexes all entries neccessary for pdo-mapping for transmitting PDOs


Generated on Wed Dec 25 01:04:57 2002 for CANopen SlaveLib by doxygen1.2.17