Supported platforms: CODESYS 2.3, CODESYS 3.5
This library contains CANopen PLCopen functions.
For CODESYS 3.5 library this topic applies only for 3.X.X.X versions. For CANopen V4 see new topics. |
The application calls the CANopen library which uses the CANVXD library to send and receive CAN messages. The CANVXD library communicates with the CANDrv(HW) library which controls the physical interface of the CAN bus.
The application then calls protocol initializations according to the following table. The needed protocol init and update functions are listed in the table's columns. The ProtocolData column shows the data storage used by each protocol (struct table). CANopenUpdateDevices updates each protocol and internally calls the update function of each protocol that has been used.
ProtocolType |
POU |
CALLParam |
ProtocolData |
Update |
Init |
OD |
- |
- |
CANopenOD |
- |
- |
NMT slave |
CANopenNMTCLIENT |
DeviceAddress |
CANopenNMT |
CANopenNMTCLIENT.Update |
CANopenNMTCLIENT.Init |
- |
- |
- |
- |
- |
|
EMCY producer |
- |
- |
CANopenEMCYProtocol |
CANopenEMCYs.Update |
CANopenEMCYs.Init |
SDO server |
CANopenSDOSERVER |
DeviceAddress |
CANopenSSDO |
CANopenSDOSERVER.Update |
CANopenSDOSERVER.Init |
- |
- |
- |
- |
- |
|
RPDO |
CANopenPDO |
CANopenPDO |
CANopenDefPDO |
CANopenPDORead |
- |
TPDO |
- |
- |
CANopenDefPDO |
CANopenPDOSend |
- |
SYNC consumer |
CANopenSYNCProtocol |
DeviceAddress |
CANopenSYNC |
- |
CANopenSYNCProtocol.Init |
- |
- |
- |
- |
- |
|
HB consumer |
CANopenHBConsumer.RCVState |
CANopenHeartBeat |
CANopenHeartBeatConsumer |
CANopenHBConsumer.Update |
CANopenHBConsumer.Init |
DevErrors |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
|
NodeGuard |
- |
- |
- |
- |
- |
Note: Grey colored protocols are not implemented in CANopen library.
POU |
Description |
CANopenDeviceAddProtocol (FUN) |
Adds Protocol to device. |
CANopenGetProtocolData (FUN) |
Returns pointer to required protocol data. |
CANopenInitDevices (FUN) |
Calls all devices protocols initialization POUs. |
CANopenSystemAddDevice (FUN) |
Adds Device to system. |
CANopenUpdateDevices (FUN) |
Calls all devices protocols update POUs. |
POU |
Description |
CANopenODAddLine (FUN) |
Adds or updates a line in Object Dictionary. |
CANopenODAddTypedef1to9 (FUN) |
Adds type definition indexes 1-9 to given OD. |
CANopenODGetData (FB) |
Gets pointer to subindex of given OD line. |
CANopenODGetIndexDataSize (FUN) |
Returns index data size in bytes. |
CANopenODGetIndexInstPtr (FUN) |
Returns pointer to OD entry of given OD index. |
CANopenODGetLine (FUN) |
Returns line number of requested index in given OD if found. |
CANopenODReOrg (FUN) |
Order Object Dictionary by ascending index. |
POU |
Description |
CANopenEMCYActivate (FUN) |
Adds given EMCY object from list of active EMCYs. |
CANopenEMCYDeactivate (FUN) |
Removes given EMCY object from list of active EMCYs. |
CANopenEMCYs |
EMCY protocol handler. Includes actions (CODESYS 2.3) or methods (CODESYS 3.5) for EMCY protocol communication. |
POU |
Description |
CANopenPDO (FB) |
PDO protocol handler. Includes actions (CODESYS 2.3) or methods (CODESYS 3.5) for PDO protocol communication. |
CANopenRPDO (FB) (CODESYS 3.5) |
Handler for received PDOs. |
CANopenTPDO (FB) (CODESYS 3.5) |
Handler for PDO transmission. |
POU |
Description |
CANopenSYNCProtocol |
SYNC protocol handler. Includes actions (CODESYS 2.3) or methods (CODESYS 3.5) for SYNC protocol communication. |
POU |
Description |
CANopenSDOSERVER |
SDO protocol server. The function block handles incoming SDO client messages. |
POU |
Description |
CANopenNMTCLIENT |
NMT protocol handler. Includes actions (CODESYS 2.3) or methods (CODESYS 3.5) for NMT protocol communication. |
POU |
Description |
CANopenConsumeHB (FUN) |
Adds HeartBeat to list of consumed HBs. |
CANopenHBConsumer |
HeartBeat protocol handler. Includes actions (CODESYS 2.3) or methods (CODESYS 3.5) for HB protocol communication. |
CANopenHeartBeat (FB) (CODESYS 2.3) / CANopenHeartBeatProducer (FB) (CODESYS 3.5) |
HeartBeat message handler. Includes actions (CODESYS 2.3) or methods (CODESYS 3.5) for HB message receiving. |
CANVXD library
Source file Topic000216.htm
Last updated 19-Dec-2024