How-to & Trace description guide: CanOpen

Basically B&R PLCs can either be CanOpen Masters or CanOpen slaves depending on the used hardware:

CanOpen masters:

  • X20IF1041-1 (CanOpen NetX master module) - this hardware can be used on X20 PLCs or even on a X20BC1083 (PLK buscontroller with IF subslot)

  • X20IF1070/X20IF2772/IF2792 (Can Interface cards) - this IF modules are plain CAN modules but our AR offers a software CanOpen master running on the PLC and using the CAN interface to send CanOpen messages.

CanOpen slaves:

  • X20IF1043-1 (CanOpen NetX slave module) - this hardware can be used on X20 PLCs or even on a X20BC1083 (PLK buscontroller with IF subslot)
  • X20BC0043-10 (CanOpen buscontroller suitable to connect X2X modules next to it) - this hardware can be used on ANY CanOpen master (also non B&R masters) to attach X2X IO modules next to it. The predecessor X20BC0043 is obsolete and should no longer be used and is furthermore not compatible with the BC0043-10.

Terminology

CanOpen is a international standard with a widely used terminology and most likely you will come across following terms:

PDO - process data object (your data)

SDO - service data object (configuration data)

NMT - network management telegram (commands for the stations)

transmission type - specifies how PDOs are transmitted

Heart Beat / Node Guarding - telegrams to monitor stations

RTR - remote transmission request - a telegram to ask for data

SYNC - a telegram to force stations to send data

EDS / DCF File - a file describing CanOpen slaves and their configuration data, capabilities and cyclic data

more information about CanOpen can be found on the CiA (CAN in automotion) homepage

Please note that all CiA Specifications (like the DS301 for example) is not free of charge and must therefor be purchased at the CiA and Int. Support will not hand out any CiA document

Troubleshooting and things to take care

  • CanOpen is based on CAN physics which means that the cable must be shielded and terminated on both ends using a 120 Ohm resistor between CAN High and CAN Low
  • always check used node numbers and if the setting between master and slave is OK
  • Analyzing the bus in case of problems is impossible without proper trace hardware. B&R does not offer such HW and basically any so called “Can Analyzer” can be used. We use one from an Austrian company called “LarSys”

Example 1 - two B&R PLCs communicate via CanOpen

  • per default 4 PDOs are configured with each 8 bytes - this can be chaned but for this example we will use it

  • compile and create a CF

  • now create a second configuration with any PLC you own but this time enter a X20IF1043-1

  • ensure that the node number and Baudrate fis to the master

  • compile and create a CF

  • connect master and slave together using a CAN cable

  • go online on the master and checj the slaves ModuleOK → should be TRUE

Here is what is happening on the bus

The master will constantly try to reach the slave via a reset command and reading of a mandatory object (vendor ID)
image
image

The slave is till now not reacting (it is still booting)

At a certain point the slave will send a so called “Bootup message” (message 1995)

image
image

→ the master reacts to this and sends a NMT Reset Node 2 (message 1997)

This is done to get a “fresh” start up of the slave which will result in second “Bootup” of the slave (message 1999)

Now the master starts to configure the slave via SDO telegrams. Basically it sends down all parameters and their values described in the EDS and set in the AS project



When everything is downloaded then the master will send a NMT “Start node 2” and

immediately the slaves sends its PDOs for the master

image
image

The master will also send guarding requests which the slave answers - the data toggles between “05” and “85”
image
image

This is the default setting of our master for slaves:

If you now set outputs on the masters for the slave these PDOs will also be sent:

Example 2 - B&R PLC with software master and an X20BC0043-10

  • create a new project and as PLC you choose “CanOpenCPU”

  • attach the X20BC0043-10 and any necessary IO module

  • save and compile → AS will generate an EDS file for you which not only contains the BC0043-10 but also the IO modules

  • the files can be found in the projects folder …\Temp\Objects\Slave\CANopenCPU\AsFDOutput

  • create a second configuration or project and enter the PLC you own and enter a suitable CAN interface (this will NOT work with X2X Can modules like the CS1070 )

  • Use “Tools → manage 3rd party devices” and"import fieldbus device" to import either the EDS or DCF file which was created (we suggest to use the DCF file):

  • then attach the BC HW to the masters interface

  • AS will ask if you want to enable CanOpen

  • set a time for node observation

Here is what is happening on the bus

Basically the same as in example 1

As guarding is now “Heartbeat” the telegrams are a bit different as in example 1

→ both the master and slave send heartbeat at a certain time without request (this is different to node guarding) and the status will be “05” all the time

4 Likes