CANopen Slave Documentation
Version 6.16.04
Loading...
Searching...
No Matches
Initialization Process

The CANopen Slave is initialised with CosMgrInit(). This routine will setup the CAN controller and initialise all necessary services. Afterwards the stack can be started by calling the CosMgrStart() function.

In summary three steps are necessary to run the CANopen Slave:

The initialization functions of the CANopen Slave Protocol Stack have to be executed prior to any other API functions.

Starting in Classical CANopen mode

void MyCosInit(void)
{
//----------------------------------------------------------------
// Initialise the CANopen slave stack
//
//----------------------------------------------------------------
// Start the CANopen Slave, node-ID = 1,
// nominal bitrate = 500 kBit/s,
//
//----------------------------------------------------------------
// now the CANopen Slave stack is initialized and
// has to be triggered by calling CosTmrEvent() with
// a cycle time of COS_TIMER_PERIOD
}
@ eCP_BITRATE_500K
Definition canpie.h:677
@ eCP_BITRATE_NONE
Definition canpie.h:642
@ eCP_CHANNEL_1
Definition canpie.h:732
uint8_t CosMgrInit(uint8_t ubCanIfV, uint16_t uwConfigV)
Initialise the CANopen Slave.
#define COS_CONF_SLAVE
Definition cos_mgr.h:83
uint8_t CosMgrStart(uint8_t ubNodeIdV, int32_t slBitrateNomSelV, int32_t slBitrateDatSelV)

Starting in CANopen FD mode

void MyCosInit(void)
{
//----------------------------------------------------------------
// Initialise the CANopen slave stack
//
//----------------------------------------------------------------
// Start the CANopen FD Slave, node-ID = 1,
// nominal bitrate = 500 kBit/s, data bitrate = 2 MBit/s
//
//----------------------------------------------------------------
// now the CANopen Slave stack is initialized and
// has to be triggered by calling CosTmrEvent() with
// a cycle time of COS_TIMER_PERIOD
}
@ eCP_BITRATE_2M
Definition canpie.h:692
#define COS_CONF_FD
Definition cos_mgr.h:118