CANopen FD Master Library
Making your systems precise, reliable and high-quality - 5.10.01
Functions
CANopen Master node support functions

Functions

ComStatus_tv ComNodeGetInfo (uint8_t ubNetV, uint8_t ubNodeIdV)
 
ComStatus_tv ComNodeRestore (uint8_t ubNetV, uint8_t ubNodeIdV, uint8_t ubParmSelV)
 
void ComNodeSetDefault (ComNode_ts *ptsNodeV)
 
ComStatus_tv ComNodeSetHbProdTime (uint8_t ubNetV, uint8_t ubNodeIdV, uint16_t uwHeartbeatV)
 
ComStatus_tv ComNodeStore (uint8_t ubNetV, uint8_t ubNodeIdV, uint8_t ubParmSelV)
 

Detailed Description

The CANopen Master node service can be used to share data between the CANopen slave device (node) and the CANopen Master protocol stack.

static ComNode_ts tsCoDeviceS; // structure with slave device data
ComNodeSetDefault(&tsCoDeviceS); // initialise structure
//-----------------------------------------------------------
// add this device as node with NID 2
//
ComMgrNodeAdd(eCOM_NET_1, 2, &tsCoDeviceS);
//-----------------------------------------------------------
// read mandatory values (i.e. objects 1000h & 1018h)
//

Function Documentation

◆ ComNodeGetInfo()

ComStatus_tv ComNodeGetInfo ( uint8_t  ubNetV,
uint8_t  ubNodeIdV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]ubNodeIdV- Node-ID value
Returns
Value of enumeration ComErr_e

The function reads objects 1000h, 1001h, 1008h and 1018h. The device name string (object 1008h) can have a maximum length of 32 byte. All values are copied to the members inside the associated ComNode_ts structure.

This is a non-blocking function, it returns after the SDO transfer is initiated. The user is informed about the result of the transfer via the ComSdoEventObjectReady() function. The message marker value is set to eCOM_SDO_MARKER_NODE_GET_INFO.

◆ ComNodeRestore()

ComStatus_tv ComNodeRestore ( uint8_t  ubNetV,
uint8_t  ubNodeIdV,
uint8_t  ubParmSelV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]ubNodeIdV- Node-ID value
[in]ubParmSelV- parameter group
Returns
Value of enumeration ComErr_e

The function starts the restore of parameters for the device with the given node-ID ubNodeIdV.

This is a non-blocking function, it returns after the SDO transfer is initiated. The user is informed about the result of the transfer via the ComSdoEventObjectReady() function. The message marker value is set to eCOM_SDO_MARKER_NODE_RESTORE.

◆ ComNodeSetDefault()

void ComNodeSetDefault ( ComNode_ts ptsNodeV)
Parameters
[in]ptsNodeV- Pointer to CANopen node

Initialise CANopen node structure with default values.

◆ ComNodeSetHbProdTime()

ComStatus_tv ComNodeSetHbProdTime ( uint8_t  ubNetV,
uint8_t  ubNodeIdV,
uint16_t  uwHeartbeatV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]ubNodeIdV- Node-ID value
[in]uwHeartbeatV- Heartbeat value
Returns
Value of enumeration ComErr_e

The function sets object 1017h for the device with the given node-ID ubNodeIdV.

This is a non-blocking function, it returns after the SDO transfer is initiated. The user is informed about the result of the transfer via the ComSdoEventObjectReady() function. The message marker value is set to eCOM_SDO_MARKER_NODE_SET_HEARTBEAT.

◆ ComNodeStore()

ComStatus_tv ComNodeStore ( uint8_t  ubNetV,
uint8_t  ubNodeIdV,
uint8_t  ubParmSelV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]ubNodeIdV- Node-ID value
[in]ubParmSelV- parameter group
Returns
Value of enumeration ComErr_e

The function starts the saving of parameters for the device with the given node-ID ubNodeIdV.

This is a non-blocking function, it returns after the SDO transfer is initiated. The user is informed about the result of the transfer via the ComSdoEventObjectReady() function. The message marker value is set to eCOM_SDO_MARKER_NODE_STORE.