Beijer - CANopen (Built-In)
Beijer - CANopen (Built-In)
Introduction
This manual describes how to connect a X2 Extreme to a CAN network and also how to configure
and set up driver and tag addresses in the X2 Extreme. It can be used as CANopen Master (with
NMT control) or CANopen Slave.
CANopen (Built-in)
Basic knowledge of CANopen is relevant. For a successful connection of the HMI to a CAN
Introduction network, the theory of PDOs and SDOs variables must be known. A CANopen network
Release Notes configuration program is helpful for implementation.
Disclaimer An EDS (Electronic Data Sheet) is provided as X2CANopen.EDS file for use in CANopen
Limitations configuration programs.
Firmware Update
[+] Connecting To The Can Network Please ensure that you always have the latest operating system image in use on the panel.
[+] Settings
[+] Addressing CANopen
[+] Troubleshooting
[+] Additional Information CANopen is a CAN-based higher layer protocol, which can be used in a very wide range of
applications. It is an established technology with a large installed base. Process automation
Master Slave
equipment such as sensors, actuators, transmitters, drives and programmable logical controllers
Auto Configuration increasingly use digital microelectronics.
CANopen ensures that devices from different vendors can communicate efficiently in a network.
The CANopen specification belongs to the CAN in Automation (CiA) international users’ and
manufacturers’ group.
The implementation corresponds to the CANopen communication profile (CiA Draft Standard 301
V 4.02, EN 50325-4) and to the CANopen Framework for Programmable CANopen Devices (CiA
Draft Standard 302 V 3.2). Additionally index 0x1F83 is supported.
The physical layer supports the standard ISO11898-2:2016 and SAE J2284-1 to SAE J2284-5 (High
Speed CAN).
For information about the controller we refer to the manual for the current system.
Release Notes
Version Release Description
Help files updated for X2 pro panels.
5.04.00 April 2019
Firmware V1.0.0.8 included.
Support for Node Guarding (by the Master) added.
5.03.00 March 2019
Firmware V1.0.0.8 included.
Help files updated for X2 pro panel support.
5.02.00 October 2018
Firmware V1.0.0.7 included.
First version for release.
5.01.00 February 2018
Firmware V1.0.0.7 included.
Disclaimer
Please note that changes in the controller protocol or hardware, which may interfere with the
functionality of this driver, may have occurred since this documentation was created. Therefore,
1 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
always test and verify the functionality of the application. To accommodate developments in the
controller protocol and hardware, drivers are continuously updated. Accordingly, always ensure
that the latest driver is used in the application.
Firmware Update
The CANopen driver uses a firmware which is, if necessary, updated automatically by the driver
during boot of the HMI project.
If it is necessary to prevent the driver to update the module firmware this can be done by
copying a file named "nofirmwareload.txt" to the sub folder "project files" in the main project
folder.
Note:
It is always recommended to let the driver update the firmware.
Note:
If you get communication errors after a firmware update, please reset your panel by power
disconnect.
On X2 Extreme panels two CAN channels (1, 2) are available. Each CAN channel can be connected
to a different CAN bus.
Termination
On a CAN bus a termination of 120 Ohm is needed at each end of the bus. That means if this
panel is at one of this ends a termination is needed.
Galvanic isolation
X2 Extreme panels have this hardware configuration:
CAN cable
A typical CAN cable uses CAN_H, CAN_L and CAN_SHLD. For best results the data lines CAN_L and
CAN_H must be twisted. The shield CAN_SHLD must be connected to all CAN devices (CDs).
2 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
The CAN cable should be as short as possible. The ends of the cable must be terminated (T) with
120 Ohm. This can be a simple resistor at the end of the cable or it can be included in one of the
CDs (here CD1).
In addition the CAN cable plugs can be connected to earth directly.
CANopen (Built-in)
Introduction
Release Notes
Disclaimer
Limitations
Firmware Update
[+] Connecting To The Can Network
[+] Settings
[+] Addressing
In some CANopen configurations other signals provided on the CAN connector (like CAN_GND) are
[+] Troubleshooting used.
[+] Additional Information
Master Slave Note: Do not connect more than 32 nodes to one CAN cable without repeater.
Auto Configuration
CAN cable length
The maximum length of a CAN bus cable (without repeater) depends on the baudrate.
Communication Ports
The following communication ports are available. Splitter cables can be used to connect multiple
serial interfaces simultaneously, please see chapter Cables.
X2 pro 7 - B2 - 2eth
X2 pro 10 - B2
X2 pro 12 - B2
X2 pro 15 - B2
X2 marine 7 - B2 HB
X2 marine 7 - B2 SC
X2 marine 15 - B2
X2 control 4 - B2
X2 control 7 - B2
BoX2 pro
BoX2 pro SC
X2 pro 21 - B2
X2 marine 7 - B2 HB SC
X2 marine 15 - B2 HB
X2 marine 15 - B2 SC
X2 marine 15 - B2 HB SC
3 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
X2 control 10 - B2
X2 control 12 - B2
X2 control 15 - B2
X2 Extreme
X2 Extreme HP
X2 Extreme SL HP
4 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
Cables
CAB109
Splitter cable when using a combination of R232 and RS422 communication.
5 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
CAB150
Splitter cable when using a combination of RS232 and RS485 communication.
CANopen (Built-in)
Introduction
Release Notes
Disclaimer
Limitations
Firmware Update
[+] Connecting To The Can Network
[+] Settings
[+] Addressing
[+] Troubleshooting
[+] Additional Information
Master Slave
Auto Configuration
Settings
Parameter Description
CAN interface Selects the interface CAN 1 or CAN 2.
Selects the used baudrate: 1M, 750k, 500k, 250k, 125k, 100k, 50k, 20k.
Baud rate
Note:
[bits/s]
It is recommended to not use 1 MBaud on X2 Pro panels.
If 1 MBaud is needed please use an X2 Extreme panel.
Station address The CAN node number of the HMI (1-127).
6 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
Selects if the HMI shall act as a network NMT master or a I/O slave node, for
Master/Slave
more information see chapter Master/Slave.
As a master, an automatic configuration can be built and a simple network
can be started.
This are the supported modes:
Parameter Description
CANopen (Built-in) Disable There is no automatic configuration.
In this mode all slaves in the network
Introduction
are first reset to the factory settings
Release Notes then the configuration is read and
Disclaimer used.
EnableCallingSlaveFactorySettings
Limitations When using this all called slaves must
Firmware Update have a valid default configuration and
[+] Connecting To The Can Network support the index 0x1011 in the Object
Master Dictionary.
[+] Settings
[+] Addressing Automatic In this mode the configuration is read
Config from all slaves in the network. There
[+] Troubleshooting
is no call for factory defaults setting
[+] Additional Information before.
Master Slave EnableWithCurrentSlaveSettings This mode is normally used when the
Auto Configuration slaves start with a specific
configuration which was saved once
and will be used on every following
start.
When Automatic Config is enabled then the heartbeat of the slaves is turned
on and it is supervized by the master.
A saved configuration can be cleared by a driver command (write to
DCF_CLEAR).
For more information about automatic configuration please see chapter Auto
configuration.
The master goes into operational state after successful network boot. The
slave goes to operational regardless of the network state.
Automatic
If disabled the device stays in PRE-OPERATIONAL. When using the HMI as a
Start
slave it is recommended to disable automatic start since this should be done
by the NMT master.
Selects the address format of the tags in the project.
Example:
Decimal/Hex
Dec: 50:SDO8064.0.20
notation
Hex: 32:SDO1F80.0.14
Note: Values used in the driver settings are always decimal.
It is possible to give the slave a different default setting, this is useful if the
slave is not configured from outside.
For info about the different default settings, see the table below.
Default
slave
Description
PDO
mapping
No default setting
0
Corresponding EDS file: X2CANopen.EDS
4 TPDO and 4 RPDO, mapped as 8 bytes each.
RPDO1-4 = 0x200 + node, 0x300 + node, 0x400 + node,
Default Slave
0x500 + node.
PDO setting 1
TPDO1-4 = 0x180 + node, 0x280 + node, 0x380 + node,
0x480 + node.
Corresponding EDS file: X2CANopen_Default_PDO1.EDS
12 TPDO and 12 RPDO, mapped as 4 words each.
RPDO1-12 = 0x240 + node to 0x24B + node.
2
TPDO1-12 = 0x1C0 + node to 0x1CB + node.
Corresponding EDS file: X2CANopen_Default_PDO2.EDS
Same as 1 but with 1 sec heartbeat.
3
Corresponding EDS file: X2CANopen_Default_PDO3.EDS
Same as 2 but with 1 sec heartbeat.
4
Corresponding EDS file: X2CANopen_Default_PDO4.EDS
Supervising You can select between Heartbeat (default), Node Guarding and None.
mode Before this feature was added this setting was fixed to Heartbeat internally.
When supervising is set to Heartbeat then all slaves are configured by the
Cycle time for
master to send a heartbeat message after this time cyclical.
supervising
When supervising is set to Node Guarding then the master requests a
(in
heartbeat answer from all slaves after this time cyclical.
milliseconds)
This feature is only valid if configured as master.
Life Time Factor used when supervising is set to Node Guarding.
Life Time Latest after ("Life Time Factor" * "Cycle time for supervising") an answer must
Factor be returned by the slave else an error will be created.
This feature is only valid if configured as master.
7 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
Advanced
CANopen (Built-in)
Introduction
Release Notes
Disclaimer
Parameter Description
Limitations
Firmware Update Enables read/write of unicode characters to the controller. Note
Enable unicode that each character in a unicoded string will use two bytes of the
[+] Connecting To The Can Network
memory in the controller.
[+] Settings
Byte order Sets the byte order of the unicode character.
[+] Addressing
[+] Troubleshooting The number of milliseconds of silence on the port before the next
retry is sent.
[+] Additional Information
Master Slave Timeout Note that functions that uses the HMI as a gateway for passing on
Auto Configuration communication may require a higher Timeout value. Transparent
mode, Routing, Passthrough mode, Modem and Tunneling are such
functions.
Retries Number of retries before a communication error is detected.
How long to wait after a communication error before trying to
Offline station retry time
restore communication.
Hides the error message that is displayed on communication
Hide comm error
problem.
Special commands that can be passed to the driver. For available
Command line options commands for this driver see chapter commands.
NOTE: This chapter does not exist for all drivers.
Addressing
The addressing is independent of slave and master mode. The driver supports SDO, RPDO, TPDO,
NMT commands, node state reads and some extra module commands. SDO and NMT commands
are only available, if the CANopen driver is configured as master.
The addressing depends on the Dec/Hex notation selection in the driver parameters.
General Addressing
SDO
Syntax: N:SDOX.Y.Z
where N is the target node, X is the index number in the object dictionary, Y is the sub index and
Z is the size in number of bytes (read: 1-32, write: 1-4).
Note: SDO access only works on master nodes. If the CANopen driver is configured as slave then
SDO commands are ignored.
Note: An external SDO read on a not existent external node will take a SDO timeout time and
therefore cause an error. But even if the node exists, SDO reads can be slow. So put external SDO
reads in long term group calls (e.g. every 10 seconds).
If you monitor SDOs on the CAN bus, be aware that SDO index and data are Intel-formatted on
the CAN bus (low -> high). In the driver and in this manual all datas are Motorola-formatted (high
-> low).
Example Description
SDO access to node 50, index 0x1F82, subindex 0x32, length 2 bytes
32:SDO1F82.32.2 (Hex) Request NMT state of node 50
(alternative call: 32:NMT_STATE)
SDO access to node 50, index 0x1F82, subindex 3, length 2 bytes
32:SDO1F82.3.2 (Hex) Request NMT state of node 3
(alternative call: 3:NMT_STATE)
8 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
This also works for bits in bytes, if you have PDO1, byte 7 = 1001.0110
Additional Commands
NMT STATE
The state of the network management (NMT) is according to the definition in DSP302.
Note: the result of NMT_STATE with and without prefix can have different results. If the module
is master, the NMT network state (without prefix) can be operational, but the Master node state
(with prefix) can be pre-operational.
9 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
NMT commands
There are five NMT write commands. They can only be used if the node is the master. They are
all node related. Use the node number followed by the separator ":" as prefix. If you use the
node number 128 (0x80) this command will address all nodes on the network like a broadcast.
Syntax Description
node:NODE_PRE_OPERATIONAL Set the node/nodes in pre-operational state.
node:NODE_OPERATIONAL Set the node/nodes in operational state.
node:NODE_RESET Reset the node/nodes.
node:NODE_COMMUNICATION_RESET Reset communication on the node/nodes.
Stop the node/nodes.
node:NODE_STOP To start the node again use NODE_OPERATIONAL or
NODE_PRE_OPERATIONAL
Examples:
Syntax: DCF_STATE
10 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
Syntax: DCF_CLEAR
Syntax: DCF_SAVE
DCF_STATE returns a 32-bit value. If it is 0xFFFFFFFF (-1) the DCF is empty. If it is 0x65766173
(which corresponds to the text “save”) it is in use. Because of this in the developer you can use a
text element and use Configure Texts to show a "saved" in the second case and for every other
value e.g. an "empty". A write on DCF_CLEAR clears the file dcf.bin. This setting will be valid
CANopen (Built-in) after the next start. Writing to DCF_SAVE will store the current configuration to the file dcf.bin.
Make sure that the CAN network is not connected otherwise the master may be busy with higher
priority tasks.
Introduction
Release Notes
Disclaimer
Limitations Note: The file dcf.bin can be deleted on a download of a project to the panel. You have to
decide if you want to delete it or reuse it with the new project downloaded.
Firmware Update
[+] Connecting To The Can Network
[+] Settings
[+] Addressing
[+] Troubleshooting
[+] Additional Information Troubleshooting
Master Slave
Auto Configuration
Error Messages
Error message Description
The communication between the driver and the firmware
Controllername: Comm err has failed.
station X • Make sure the latest CANopen firmware version is
Controllername: Call to used.
CreateFile() returned error 2! • Check that the CAN master doesn't block the slave,
Controllername: Failed to test by unplugging the panel from the CAN bus.
connect driver! • Make sure the correct CAN interface (CAN 1 or CAN 2)
is used.
Trying to access an illegal or non-existing address or SDO
index.
• Check that the target node address answers correctly.
• Check the length of the read data, especially string
lengths must fit to the tag definition.
Controllername: Bad reply
• Make sure the SDO indexes exists on the target node.
station X
• Make sure that the tag addresses corresponds to the
selected address format (hex/dec) .
Example: Hex “32:SDO1f82.0.14” = Dec
“50:SDO8066.0.20”.
• Check CAN connection and termination.
Controllername: Value is larger A value larger than the number of bits/bytes allowed in a
than the area device was used.
Note:
Normally the firmware is automatically updated by the driver during boot if this is needed, the
update can be prevented though by adding a file named "nofirmwareload.txt" to the sub folder
"/Project Files" of the project. Note that it is always recommended to let the update run to make
sure that the driver- and firmware versions matches.
Note:
Not all access errors are displayed.
Only SDO accesses are responded with errors, if they do not exist. PDO accesses are returned
with value 0, if the PDO is not configured in the CAN bus network.
If you think your read/written values for PDOs or SDOs are wrong, check the addressing
concerning Dec/Hex notation.
Note:
Sending and receiving CAN messages is not only handled by the driver. There is a part running in
the operating system too. So please ensure that you always have the latest operating system
image in use on the panel.
To find out if your PDO values are correct, always check the node state with NMT_STATE. It must
be operational else the informations are not up to date.
If you have problems accessing the panel over the CAN bus, disconnect all other nodes from the
CAN bus (or switch them off). Also you can try to set “Automatic start = Disable" and reboot the
panel.
• In the master check the slave configuration with SDO (1F81, node). There should be a value
(e.g. 00,00,00,05).
• If a node is not online, but is configured in SDO (1F81, node), this will lead to bootup
errors.
11 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
Clear the values for this node (e.g. SDO1f81,3 = 00,00,00,00) and restart the panel.
• Check if heartbeat for the slave is set. Heartbeat is recommended for all relevant slaves.
• Check the PDO connections for master and slave: do they have the same ID? Does the
mapping fit together?
• Check the termination of the CAN bus. It MUST be R120 at each end (ohmmeter will show
R60). Do not connect devices behind the termination, only between the 2 resistors.
CANopen (Built-in)
Introduction
Release Notes
Disclaimer Additional Information
Limitations
Firmware Update
[+] Connecting To The Can Network Master Slave
[+] Settings
[+] Addressing
[+] Troubleshooting Use of the panel as CANopen master
[+] Additional Information
If the CANopen driver is configured as master the network can be configured manually with a
Master Slave
configuration tool (for example PCAN Magic Pro). Here is a simple example with master (node 1)
Auto Configuration and slave (node 4).
2. Make sure the DCF is empty or write to DCF_CLEAR to clear it and reboot HMI.
Alternatively to the following steps 3 to 7 a CANopen configuration tools can send a
configuration/DCF to the module.
For example:
Master TPDO1, CAN-ID 0x204, map 0x2100,1,8 (1 byte)
Master RPDO1, CAN-ID 0x184, map 0x2000,2,16 (2 byte)
Slave TPDO1, CAN-ID 0x184 map 0x6100,2,16 (2 byte)
Slave RPDO1, CAN-ID 0x204 map 0x6000,1,8 (1 byte)
5. Optional: Set Heartbeat (SDO 0x1017) of master and slave to a reasonable value, for example
250 ms.
Setting for the master:
SDO 0x1016, 1 = 2C,01,04,00 Consumer heartbeat time 300 ms
SDO 0x1017, 0 = FA,00 Producer heartbeat time 250 ms
Setting for the slave:
SDO 0x1016, 4 = 2C,01,01,00 Consumer heartbeat time 300 ms
SDO 0x1017, 0 = FA,00 Producer heartbeat time 250 ms
6. From the master set all nodes to operational (“128:NODE_OPERATIONAL”). All node states can
be read with N:NMT_STATE, which returns a value 0-127. N is the node number.
7. If everything works well, store the configuration in the flash by sending the CANopen
command 1:SDO,1010,1 = 73,61,76,65 (“save”) or store it with a driver command by writing to
DCF_SAVE. Make sure that no other CAN devices are connected to the CAN bus. Afterwards
reboot the HMI and it will start with the configuration stored before. This storage needs 2
second, so enlarge your SDO timeout when using this SDO call. In the DCF_STATE tag you can now
read “save”.
1. Choose driver parameters: baudrate, station address, Master/Slave = Slave, Master Automatic
Config = Disable, Automatic Start = Disable. Download the project to the HMI, the projects starts
automatically.
2a. Mapping
Map the slave TPDOs and RPDOs as desired, use objects 0x2000 (RPDOs) or 0x2100 (TPDOs).
12 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
The access to TPDOs and RPDOs is the same as in Master mode. The slave state can be read with
NMT_STATE, which returns a value 0-127.
Note: Node:NMT_STATE does not work on a slave. Only the own state can be read with
NMT_STATE.
With "X2CANopen.EDS" the use of these objects is limited to 64 PDOs, but the master firmware
can handle 127. To use upper PDOs use dynamic objects 0xA4C0 and 0xA040, as described in the
chapter Auto Configuration.
Subindex Description
1 Generic receive byte 1 (MSB)
2 Generic receive byte 2
3 Generic receive byte 3
4 Generic receive byte 4
5 Generic receive byte 5
6 Generic receive byte 6
7 Generic receive byte 7
8 Generic receive byte 8 (LSB)
9 Generic receive word 1 (byte 1 + 2)
10 Generic receive word 2 (byte 3 + 4)
11 Generic receive word 3 (byte 5 + 6)
12 Generic receive word 4 (byte 7 + 8)
13 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
1. Write a DCF and store it in the master. Now on start the master will copy the DCF information
to the slave at bootup.
2. Set “expected configuration time/date” (master SDO 0x1f26, SDO 0x1f27) equal to “verify
configuration” (slave SDO 0x1020,1, SDO 0x1020,2). If there is the same value ≠ 0 (for example =
1), the master assumes the slave to be already configured and does not overwrite it.
Auto Configuration
Here you can find the steps to use the implemented automatic configuration.
2. Choose driver parameters: baudrate, station address and Master/Slave = Master. When the
slaves have already stored a configuration different from the Default factory configuration then
the variable Master Automatic Config has to be set to EnableWithCurrentSlaveSettings. If the
Default factory setting of the slaves should be used then Master Automatic Config has to be set
to EnableCallingSlaveFactorySettings. Download the project to the HMI, the projects starts
automatically..
3. Now the panel tries to build a CANopen network, calling the slaves by SDOs. If it succeeds, it
builds a configuration with dynamic objects and starts the network. If it fails, a reason might be
that the slave has no default values. If another X2 Extreme is used as slave, make sure that on
this module Master Automatic Config is set to Disable because auto configuration can be handled
by the master only. Choose a fitting default PDO configuration for the CANopen slave in the
driver parameters.
The auto configuration is build with dynamic objects 0xA4C0 and 0xA040.
RPDOs:
Mapped 8 objects (bytes) to the RPDO1:
1. Object 0xA4C0, subindex 0x01 (byte 1), length 8 bit (1 byte)
2. Object 0xA4C0, subindex 0x02 (byte 2), length 8 bit (1 byte)
3. Object 0xA4C0, subindex 0x03 (byte 3), length 8 bit (1 byte)
4. Object 0xA4C0, subindex 0x04 (byte 4), length 8 bit (1 byte)
5. Object 0xA4C0, subindex 0x05 (byte 5), length 8 bit (1 byte)
6. Object 0xA4C0, subindex 0x06 (byte 6), length 8 bit (1 byte)
7. Object 0xA4C0, subindex 0x07 (byte 7), length 8 bit (1 byte)
8. Object 0xA4C0, subindex 0x08 (byte 8), length 8 bit (1 byte)
14 / 15 7.10.2022 21:45
CANopen (Bu�lt-�n) f�le:///C:/Users/orhan/AppData/Roam�ng/Be�jer%20Electron�cs%20...
If everything works then store the configuration in the module by sending SDO,1010,1 =
73,61,76,65 (“save”). The storing takes longer than the other commands so you have to set the
timeout for this SDO > 2 s or store it on the panel by writing to DCF_SAVE.
Reboot HMI and it will start with this fixed configuration. A a saved boot configuration has higher
priority than the automatic configuration.
15 / 15 7.10.2022 21:45