CANopen Master Documentation
Version 6.06.04
|
The file com_conf.h holds all definitions for the configuration of the CANopen FD Master protocol stack. Please set the symbols to an appropriate value in order to achieve a specific CANopen FD Master behaviour.
#define COM_BUS_EMCY 0 |
With this symbol it is possible to enable the transmission of emergency messages upon bus errors. The functionality is handled inside the function ComMgrCanErrorHandler().
#define COM_CIA302_NV 0 |
Support CiA 302 Network Variables.
This symbol defines if network variables from CiA 302 are included in the dictionary.
#define COM_DICT_MAN 0 |
This symbol defines if manufacturer specific objects are included in the dictionary. A value of 0 means the manufacturer objects are not included. A value of 1 means they are included.
#define COM_DICT_OBJ_1008 0 |
Implementation of index 1008h.
This symbol defines if the object 1008h (device name) is supported by the protocol stack.
#define COM_DICT_OBJ_1009 0 |
Implementation of index 1009h.
This symbol defines if the object 1009h (hardware version) is supported by the protocol stack.
#define COM_DICT_OBJ_100A 0 |
Implementation of index 100Ah.
This symbol defines if the object 100A (software version) is supported by the protocol stack.
#define COM_EMCY_CONS_SUPPORT 1 |
The symbol defines if the EMCY Consumer service is supported. If a consumer EMCY was received the ComEmcyConsEventReceive() will be called and user can handle the event. Setting this symbol to 1 requires that COM_EMCY_SUPPORT is enabled.
A CANopen Master EMCY Consumer will be configured by ComEmcyConsSetId() and enabled by calling ComEmcyConsEnable().
#define COM_EMCY_QUEUE 4 |
The symbol defines if the size of the EMCY producer message queue.
#define COM_EMCY_SUPPORT 1 |
The symbol defines if the EMCY service is supported.
#define COM_FD_SUPPORT 0 |
Support CANopen FD.
This symbol defines if the protocol stack supports CANopen FD functionality defined by the CiA 1301 specification. Support for CANopen FD also requires a CAN FD capable hardware, hence the symbol CP_CAN_FD provided by the CANpie driver must be set to 1.
Possible values for this symbol are:
If CANopen FD support is configured during compile time, it has to be enabled during run-time as depicted in the following example.
#define COM_J1939_SUPPORT 0 |
The symbol defines if SAE J1939 is supported.
#define COM_LED_SUPPORT 0 |
With this symbol the LED support can be enabled. There are two LEDs supported: a Network LED and a Module LED. The Network LED denotes the state of the CANopen status machine (Operational, Stopped, Bus-Off, etc.). The optional Module LED denotes the physical state of the device (running, hardware failure, etc).
#define COM_LSS_SUPPORT 1 |
LSS offers the possibility to inquire and change the settings of certain parameters of the local layers on a CANopen module with LSS Slave capabilities. This switch is used to enable/disable the LSS capability. If enabled, the file com_lss.c must be included to the project.
#define COM_MGR_INT 1 |
With this symbol it is possible to switch the CAN message handler (message reception) between Polling- and IRQ-mode. In Polling mode the messages are read from the buffer during the main loop. The default mode is the IRQ-mode: received CAN messages are processed inside the CAN IRQ-handler.
#define COM_NET_MAX 1 |
This symbol defines the maximum number of CANopen FD Master networks in a system. The value is typically equal to the number of physical CAN interfaces. The maximum number of logical CANopen networks is limited to 8.
#define COM_NMT_FLYING_MASTER 1 |
With this symbol it is possible to enable the NMT Flying Master functionality and protocol.
#define COM_NMT_GUARDING 0 |
With this symbol it is possible to enable the NMT node guarding protocol. It is disabled by default.
#define COM_NMT_GUARDING_FIFO_SIZE 8 |
This symbol defines the FIFO size for the NMT node guarding protocol. The default value is 8.
#define COM_NMT_HEARTBEAT_CONSUMER 1 |
With this symbol it is possible to enable the NMT Heartbeat consumer service. It is enabled by default. Setting this symbol to 0 means that index 1016h is not supported and the NMT state of other nodes in the network cannot be tested.
#define COM_NMT_MASTER_PRIORITY 1 |
This symbol defines the NMT master priority for the flying master negotiation procedure. Possible values are:
#define COM_NODE_MAX 127 |
This symbol defines the maximum number of CANopen devices in a network. The default value is 127, which is also the maximum value. A lower value has an impact on the required memory resources (lower RAM requirements).
#define COM_NRL_SUPPORT 0 |
Support of Network Redundancy Layer.
With this symbol the Network Redundancy Layer (NRL) support can be enabled. In case the CANopen Master protocol stack has direct access to the NRL layer the symbol must be set to 1. When the NRL is running on a remote interface (e.g. NRL and CANpie FD driver are accessed via SPI) the symbol must be set to 2.
#define COM_PDO_RCV_MAX 32 |
This symbol defines the number of receive PDOs used by the CANopen Master stack. The number can be in the range of 0 (no receive PDO) and 512 (maximum number of PDOs). The number has an impact on the required RAM size.
#define COM_PDO_TRM_FIFO_SIZE 16 |
This symbol defines the FIFO size for the Transmit PDOs. The default value is 16.
#define COM_PDO_TRM_MAX 32 |
This symbol defines the number of transmit PDOs used by the CANopen Master stack. The number can be in the range of 0 (no transmit PDO) and 512 (maximum number of PDOs). The number has an impact on the required RAM size.
#define COM_SDO_CLIENT_MAX 1 |
The symbol defines the number of SDO clients that are supported. Possible values are 1 to 127. The number has an impact on the required CAN message buffers and the code size.
#define COM_SDO_SRV 1 |
The symbol defines if a SDO server is supported. If the SDO server is disabled, an object dictionary for the CANopen Master stack is not generated.
#define COM_SDO_SRV_BLOCK 0 |
The symbol defines if the SDO Block transfer is supported. A value of 0 denotes that SDO Block transfer is not supported. A value greater 0 denotes the maximum number of blocks that can be transferred between master and slave. The maximum value is 127 blocks.
#define COM_SDO_SRV_SEGMENTED 1 |
The symbol defines if the segmented SDO transfer is supported. If segmented SDOs are not supported, the code size can be reduced. However, segmented SDOs are required if the data type STRING must be supported with string length greater than 4.
#define COM_SRDO_NUMBER 0 |
This symbol defines the number of SRDOs which can be managed by the CANopen Master protocol stack. The allowed value range is 0 (no CANopen Safety support) to 64.
#define COM_SRDO_TRM_FIFO_SIZE 16 |
This symbol defines the FIFO size for transmission of SRDOs. The default value is 16.
#define COM_SYNC_SUPPORT 1 |
The Synchronization Object is broadcasted periodically by the SYNC producer. This SYNC provides the basic network clock. This switch is used to control the SYNC capability. If enabled, the file com_sync.c must be included to the project.
The SYNC transmission can either be controlled by the protocol stack (using ComSyncSetCycleTime() to configure the cycle time) or manually be the application (using ComSyncSend()). The two options are mutually exclusive.
#define COM_TIME_SUPPORT 1 |
The symbol defines if the TIME service is supported.
#define COM_TIMER_PERIOD 1000 |
This symbol defines the period of the timer interrupt. The value is a multiple of 1 microsecond. It is used for timing services. Please set this value to the timer interrupt period of the target system.
Please note that the value must be at least 1000 [microseconds], because all CANopen services use a multiple of 1 millisecond.
#define COM_USDO_CLIENT_MAX 1 |
The symbol defines the number of USDO clients that are supported. Possible values are 1 to 127. The number has an impact on the required CAN message buffers and the code size.
#define COM_USDO_SRV 0 |
The symbol defines if a USDO server is supported. If the USDO server is disabled, an object dictionary for the CANopen Master stack is not generated. The USDO server is only avaliable if CAN FD support is available (see COM_FD_SUPPORT).