CANopen Master Documentation
Version 6.08.00
|
This module covers the functionality of the specification CiA 302-6 and CiA 1302-6.
Functions | |
uint8_t | ComIdx1F62_NrlConfig (uint8_t ubNetV, uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
uint8_t | ComIdx1F63_NrlMonitor (uint8_t ubNetV, uint8_t ubSubIndexV, uint8_t ubReqCodeV) |
void | ComNrlEventHandler (uint8_t ubNetV, uint8_t ubNrlStateV) |
ComStatus_tv | ComNrlInit (uint8_t ubNetV, uint8_t ubPhyIfDclV, uint8_t ubPhyIfRclV, CpNrlDriver_ts *ptsNrlDriverV, uint8_t ubDeviationLimitV, uint32_t ulMboxTimeoutV, uint32_t ulRecoveryTimeV) |
ComStatus_tv | ComNrlRelease (uint8_t ubNetV) |
ComStatus_tv | ComNrlSendConnectionService (uint8_t ubNetV) |
ComStatus_tv | ComNrlStart (uint8_t ubNetV) |
ComStatus_tv | ComNrlState (uint8_t ubNetV, CpNrlState_ts *ptsNrlStateV) |
void | ComNrlTimerEvent (uint8_t ubNetV) |
#define COM_NRL_ACCESS_DIRECT 1 |
#define COM_NRL_ACCESS_REMOTE 2 |
uint8_t ComIdx1F62_NrlConfig | ( | uint8_t | ubNetV, |
uint8_t | ubSubIndexV, | ||
uint8_t | ubReqCodeV ) |
Index 1F62 - Network Redundancy Layer Configuration.
[in] | ubNetV | CANopen Network channel |
[in] | ubSubIndexV | Sub-index |
[in] | ubReqCodeV | read / write access |
This object controls the transmit and receive counter deviation limits of the Network Redundancy Layer.
The function returns a SDO response code defined by the ComSdo_e enumeration. The index is only available when the symbol COM_NRL_SUPPORT is set.
uint8_t ComIdx1F63_NrlMonitor | ( | uint8_t | ubNetV, |
uint8_t | ubSubIndexV, | ||
uint8_t | ubReqCodeV ) |
Index 1F63 - Network Redundancy Layer Monitoring.
[in] | ubNetV | CANopen Network channel |
[in] | ubSubIndexV | Sub-index |
[in] | 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 ComSdo_e enumeration. The index is only available when the symbol COM_NRL_SUPPORT is set.
void ComNrlEventHandler | ( | uint8_t | ubNetV, |
uint8_t | ubNrlStateV ) |
[in] | ubNetV | CANopen Network channel |
[in] | ubNrlStateV | NRL state |
This handler is called by the NRL upon state change of the NRL.
ComStatus_tv ComNrlFaultSimulation | ( | uint8_t | ubNetV, |
enum CpNrlFault_e | teFaultV ) |
ComStatus_tv ComNrlInit | ( | uint8_t | ubNetV, |
uint8_t | ubPhyIfDclV, | ||
uint8_t | ubPhyIfRclV, | ||
CpNrlDriver_ts * | ptsNrlDriverV, | ||
uint8_t | ubDeviationLimitV, | ||
uint32_t | ulMboxTimeoutV, | ||
uint32_t | ulRecoveryTimeV ) |
[in] | ubNetV | CANopen Network channel |
[in] | ubPhyIfDclV | Physical interface of Default CAN Line |
[in] | ubPhyIfRclV | Physical interface of Redundant CAN Line |
[in] | ptsNrlDriverV | Pointer to NRL driver structure |
[in] | ubDeviationLimitV | Counter deviation limit value |
[in] | ulMboxTimeoutV | Mailbox timeout value |
[in] | ulRecoveryTimeV | Time to recover from NRL passive state |
eCOM_ERR_NONE
.This function must be called by the application program prior to any other CANopen FD Master Stack function if the Network Redundancy Layer shall be supported. It is assigned to the channel defined by ubNetV, the parameters ubPhyIfDclV and ubPhyIfRclV are used to assign the physical CAN interfaces of the driver to the Default CAN Line (DLC) and Redundant CAN Line (RCL).
The parameter ubDeviationLimitV configures the deviation limit value (refer to #CpNrlSetDeviationLimit()). The parameter ulMboxTimeoutV configures the mailbox timeout value (refer to #CpNrlSetTimeout()). The parameter ulRecoveryTimeV configures the recovery timeout value (refer to #CpNrlSetRecoveryTime()).
The function returns an error code defined the the enumeration ComErr_e.
ComStatus_tv ComNrlRelease | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
eCOM_ERR_NONE
.This function releases the Network Reduncy Layer.
The function returns an error code defined the the enumeration ComErr_e.
ComStatus_tv ComNrlSendConnectionService | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
eCOM_ERR_NONE
.This function triggers the transmission of the NRL connection service. The purpose of the function is verification of the CAN connection schema (DCL/RCL). Since the NRL connection service can modify the NRL state machine it shall be used sparingly.
The function returns an error code defined the the enumeration ComErr_e.
ComStatus_tv ComNrlStart | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
eCOM_ERR_NONE
.This function must be called by the application program after ComMgrInit(). It is responsible for initialisation of the NRL connection service.
The function returns an error code defined the the enumeration ComErr_e.
ComStatus_tv ComNrlState | ( | uint8_t | ubNetV, |
CpNrlState_ts * | ptsNrlStateV ) |
[in] | ubNetV | CANopen Network channel |
[in] | ptsNrlStateV | Pointer to NRL state structure |
eCOM_ERR_NONE
.This function retrieves the current state of the NRL for the CANopen network channel defined by ubNetV.
The function returns an error code defined the the enumeration ComErr_e.
void ComNrlTimerEvent | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
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