CANopen Master Documentation
Version 6.06.04
Loading...
Searching...
No Matches
com_mobj.h File Reference

Detailed Description

The object dictionary of the CANopen Master protocol stack can be extended with manufacturer specific objects. These objects are included into the protocol stack when the symbol COM_DICT_MAN is configured as described.

The manufacturer objects are listed inside the file com_mobj.inc which is included into the internal object dictionary. Each object entry is a structure element of type ComDicEntry_s.

The provided code for manufacturer specific objects is an example. The example code adds the following objects:

Index Function Description
2000h ComMob_Idx2000() Array of UNSIGNED16 values
2001h ComMob_Idx2001() Visible String
+ Include dependency graph for com_mobj.h:

Macros

#define MOB_IDX_2000_SIZE   5
 
#define MOB_IDX_2001_SIZE   26
 

Functions

void ComMob_ParmInit (uint8_t ubNetV)
 
uint8_t ComMob_Idx2000 (uint8_t ubNetV, uint8_t ubSubIndexV, uint8_t ubReqCodeV)
 
uint8_t ComMob_Idx2001 (uint8_t ubNetV, uint8_t ubSubIndexV, uint8_t ubReqCodeV)
 

Macro Definition Documentation

◆ MOB_IDX_2000_SIZE

#define MOB_IDX_2000_SIZE   5

This symbol defines the number of array elements for the object at index 2000h.

◆ MOB_IDX_2001_SIZE

#define MOB_IDX_2001_SIZE   26

This symbol defines the maximum size of the string stored at index 2001h.

Function Documentation

◆ ComMob_Idx2000()

uint8_t ComMob_Idx2000 ( uint8_t  ubNetV,
uint8_t  ubSubIndexV,
uint8_t  ubReqCodeV 
)
Parameters
[in]ubNetVCANopen Network channel
ubSubIndexVsub-index
ubReqCodeVread / write access
Returns
Value from ComSdo_e enumeration

This function provides an example for read/write access to an array of values (16 bit unsigned). The size of the array is defined via the constant value MOB_IDX_2000_SIZE inside the implementation file.

The function is called by the protocol stack.

◆ ComMob_Idx2001()

uint8_t ComMob_Idx2001 ( uint8_t  ubNetV,
uint8_t  ubSubIndexV,
uint8_t  ubReqCodeV 
)

Index 2001h - Visible string example.

Parameters
[in]ubNetVCANopen Network channel
ubSubIndexVsub-index
ubReqCodeVread / write access
Returns
Value from ComSdo_e enumeration

This function provides an example for read/write a visible string with a maximum size of MOB_IDX_2001_SIZE byte.

The function is called by the protocol stack.

◆ ComMob_ParmInit()

void ComMob_ParmInit ( uint8_t  ubNetV)
Parameters
[in]ubNetVCANopen Network channel
Note
The code provides an example and has to be adopted to the application.

This function is used to initialise manufacturer variables with default values. The function is called by the protocol stack (refer to ComMgrInit()).