CANopen Master Documentation
Version 6.06.04
|
The CANopen Master node service can be used to share data between the CANopen slave device (node) and the CANopen Master protocol stack.
Data Structures | |
struct | ComNode_s |
Typedefs | |
typedef struct ComNode_s | ComNode_ts |
Enumerations | |
enum | ComNodeParm_e { eCOM_NODE_PARM_ALL = 1 , eCOM_NODE_PARM_COMMUNICATION = 2 , eCOM_NODE_PARM_APPLICATION = 3 , eCOM_NODE_PARM_MANUFACTURER = 4 } |
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) |
typedef struct ComNode_s ComNode_ts |
CANopen device parameter.
The structure ComNode_s keeps information about a CANopen device with a specific node-ID. In fact it holds a copy of several values from a CANopen slave device.
The elements within this structure are not ordered by index, they are ordered by data type (starting with unit32_t) in order to allow better packing, thus avoiding unaligned access.
enum ComNodeParm_e |
This enumeration defines the parameter options for storing / restoring.
ComStatus_tv ComNodeGetInfo | ( | uint8_t | ubNetV, |
uint8_t | ubNodeIdV | ||
) |
[in] | ubNetV | - CANopen Network channel |
[in] | ubNodeIdV | - Node-ID value |
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 ComObjectEventReady() function. The message marker value is set to eCOM_OBJECT_MARKER_NODE_GET_INFO.
ComStatus_tv ComNodeRestore | ( | uint8_t | ubNetV, |
uint8_t | ubNodeIdV, | ||
uint8_t | ubParmSelV | ||
) |
[in] | ubNetV | - CANopen Network channel |
[in] | ubNodeIdV | - Node-ID value |
[in] | ubParmSelV | - parameter group |
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 ComObjectEventReady() function. The message marker value is set to eCOM_OBJECT_MARKER_NODE_RESTORE.
void ComNodeSetDefault | ( | ComNode_ts * | ptsNodeV | ) |
[in] | ptsNodeV | - Pointer to CANopen node |
Initialise CANopen node structure with default values.
ComStatus_tv ComNodeSetHbProdTime | ( | uint8_t | ubNetV, |
uint8_t | ubNodeIdV, | ||
uint16_t | uwHeartbeatV | ||
) |
[in] | ubNetV | - CANopen Network channel |
[in] | ubNodeIdV | - Node-ID value |
[in] | uwHeartbeatV | - Heartbeat value |
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 ComObjectEventReady() function. The message marker value is set to eCOM_OBJECT_MARKER_NODE_SET_HEARTBEAT.
ComStatus_tv ComNodeStore | ( | uint8_t | ubNetV, |
uint8_t | ubNodeIdV, | ||
uint8_t | ubParmSelV | ||
) |
[in] | ubNetV | - CANopen Network channel |
[in] | ubNodeIdV | - Node-ID value |
[in] | ubParmSelV | - parameter group |
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 ComObjectEventReady() function. The message marker value is set to eCOM_OBJECT_MARKER_NODE_STORE.