CANopen Slave Documentation
Version 6.16.04
|
This module adds the Network Redundancy Layer (NRL) to the CANopen FD Slave protocol stack. The NRL is an optional add-on module for the CANopen FD Slave protocol stack. The NRL is enabled by setting the symbol COS_NRL_SUPPORT to 1.
The NRL must be started in advance to the CANopen FD Slave protocol stack. The following example depicts the initialization of the NRL:
The following table shows all additional objects for the CANopen FD Slave protocol stack when NRL is enabled.
Index | Description | Function / Variable | Configuration Symbol |
---|---|---|---|
1F62h | NRL configuration | CosNrl_Idx1F62() | COS_NRL_SUPPORT |
1F62h | NRL monitoring | CosNrl_Idx1F63() | COS_NRL_SUPPORT |
Functions | |
uint8_t | CosNrl_Idx1F62 (uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
uint8_t | CosNrl_Idx1F63 (uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
void | CosNrlEventHandler (uint8_t ubNrlStateV) |
Status_tv | CosNrlInit (uint8_t ubNrlChannelV, uint8_t ubPhyIfDclV, uint8_t ubPhyIfRclV, CpNrlDriver_ts *ptsNrlDriverV) |
Status_tv | CosNrlStart (uint8_t ubNrlChannelV) |
void | CosNrlTimerEvent (void) |
uint8_t CosNrl_Idx1F62 | ( | uint8_t | ubSubIndexV, |
uint8_t | ubReqCodeV | ||
) |
Index 1F62 - Network Redundancy Layer Configuration.
ubSubIndexV | sub-index |
ubReqCodeV | read / write access |
The object allows adjustment of NRL parameters in order to meet the application requirements.
The function returns a SDO response code defined by the CosSdo_e enumeration. The index is only available when the symbol COS_NRL_SUPPORT is set.
uint8_t CosNrl_Idx1F63 | ( | uint8_t | ubSubIndexV, |
uint8_t | ubReqCodeV | ||
) |
Index 1F63 - Network Redundancy Layer Monitoring.
ubSubIndexV | sub-index |
ubReqCodeV | read / write access |
This object allows to monitor the transmit and receive counter deviation values of the Network Redundancy Layer.
The function returns a SDO response code defined by the CosSdo_e enumeration. The index is only available when the symbol COS_NRL_SUPPORT is set.
void CosNrlEventHandler | ( | uint8_t | ubNrlStateV | ) |
[in] | ubNrlStateV | State of Network Redundancy Layer |
This function is called upon the occurrence of a NRL state change event. The function implementation is located in the file cos_user.c
. The value of the parameter ubNrlStateV is defined by the enumeration CpNrlState_e, detailed information about the NRL can be obtained by calling CpNrlState().
Status_tv CosNrlInit | ( | uint8_t | ubNrlChannelV, |
uint8_t | ubPhyIfDclV, | ||
uint8_t | ubPhyIfRclV, | ||
CpNrlDriver_ts * | ptsNrlDriverV | ||
) |
[in] | ubNrlChannelV | Channel of Network Redundancy Layer |
[in] | ubPhyIfDclV | Physical interface of Default CAN Line |
[in] | ubPhyIfRclV | Physical interface of Redundant CAN Line |
[in] | ptsNrlDriverV | Pointer to NRL driver structure |
eCOS_ERR_NONE
.This function must be called by the application program prior to any other CANopen FD Slave Stack function if the Network Redundancy Layer shall be supported.
The function returns an error code defined the the enumeration CosErr_e.
Status_tv CosNrlStart | ( | uint8_t | ubNrlChannelV | ) |
[in] | ubNrlChannelV | Channel of Network Redundancy Layer |
eCOS_ERR_NONE
.This function must be called by the application program after CosMgrInit(). It is responsible for initialization of the NRL control service.
The function returns an error code defined the the enumeration CosErr_e.
void CosNrlTimerEvent | ( | void | ) |
This function must be called by a timer resource of the target system. It is responsible to call the NRL fault detection and recovery. The period of the timer is defined via the symbol CP_NRL_TIMER_PERIOD.
Example