All the components are supplied in particular hardware and software configurations appropriate for the application. Modifications to hardware or software configurations other than those described in the documentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG. Personnel qualification This description is only intended for trained specialists in control, automation and drive engineering who are familiar with the applicable national standards.
CANopen system overview CANopen system overview The Beckhoff Embedded PCs can be ordered ex works with an optional interface, e.g. PROFIBUS, CANopen or RS232. Some of the optional interfaces can be delivered as master or slave. The following Embedded PCs can be ordered with an optional interface: •...
Page 9
Beckhoff website (www.beckhoff.de) for the parameterization of Beckhoff CANopen devices using configuration tools from other manufacturers. Certification The Beckhoff CANopen devices have a powerful implementation of the protocol, and are certified by the CAN in Automation Association (www.can-cia.org). CXxxxx-M510/B510...
CANopen system overview Network Management The network management (NMT) defines the communication behavior of a CANopen device and consists of the states initialization, pre-operational, operational and stopped. When a device is switched on or restarted, the device automatically switches to the initialization state. When the initialization state is completed, the device automatically switches to pre-operational state.
Page 11
CANopen system overview State transitions State transitions are executed with a CAN message. The CAN messages have a very simple structure: CAN identifier 0, with two bytes of data content. • The first data byte contains the command specifier (cs), •...
CANopen system overview 2.1.1 Boot-up message After the initialization phase and the self-test the device sends the boot-up message, which is a CAN message with a data byte (0) on the identifier of the guarding or heartbeat message: CAN-ID = 0x700 + node ID. In this way temporary failure of a module during operation (e.g.
Page 13
CANopen system overview At the time of the first guarding message of the slave the toggle bit has the value 0. Subsequently, the toggle bit alternates after each guarding message and enables lost messages to be detected. The remaining seven bits contain the node state, thereby transferring the slave status to the master.
29-bit CAN identifiers to be entered. The use of the 29-bit version is limited to special applications and is therefore not supported by the Beckhoff CANopen devices. The highest bit (bit 31) can be used to activate the process data object or to turn it off.
Page 15
CANopen system overview To exchange process data objects (SDOs) directly between the devices without a master, the CAN identifiers have to be adjusted accordingly. The TxPDO identifiers of the producer must match the RxPDO identifier of the consumer. This procedure is known as PDO linking. It permits, for sample, easy construction of electronic drives in which several slave axes simultaneously listen to the actual value in the master axis TxPDO.
Page 16
This does take longer, but does mean that the data is up-to-date. Beckhoff use CAN controllers following the principle of Basic CAN. Since this device behavior is usually not transparent to the user, and because there are CAN controllers still in use that do not support remote frames at all, polled communication will only with reservation be recommended for operative running.
Page 17
CANopen system overview The cycle time (SYNC rate) can be monitored (object 0x1006), so that if the SYNC fails the device reacts in accordance with the definition in the device profile, and switches, for sample, its outputs into the fault state. The SYNC telegram is coupled with the link task, so that new input data are available with each task start.
As a rule, the default mapping of the process data objects already satisfies the requirements. For special types of application the mapping can nevertheless be altered: the Beckhoff CANopen Bus Couplers, for instance, thus support variable mapping, in which the application objects (input and output data) can be freely allocated to the PDOs.
Page 19
CANopen system overview SDO protocol: access to the object directory The CANopen Bus Couplers are servers for the SDO, which means that at the request of a client (e.g. of the IPC or the PLC) they make data available (upload), or they receive data from the client (download). This involves a handshake between the client and the server.
Page 20
This is, however, not generally necessary, since only the less significant data bytes up to the length of the object directory entry that is to be written are evaluated. A download of data up to 4 bytes in length can therefore always be achieved in Beckhoff bus nodes with 22h in the first CAN data byte. Version: 1.0...
Page 21
CANopen system overview Client -> Server, Download Response 11 bit 8 bytes of user data identifier 0x580 0x60 Index0 Index1 SubIdx 0x00 0x00 0x00 0x00 (=1408de c) + node Parameters Explanation Index0 Index low byte (Unsigned16, LSB) Index1 Index high byte (Unsigned16, MSB) SubIdx Sub-index (Unsigned8) Breakdown of Parameter Communication Parameter communication is interrupted if it is faulty.
Page 22
CANopen system overview SDO error code Explanation 0x05 03 00 00 Toggle bit not changed 0x05 04 00 01 SDO command specifier invalid or unknown 0x06 01 00 00 Access to this object is not supported 0x06 01 00 02 Attempt to write to a Read_Only parameter 0x06 02 00 00 The object is not found in the object directory 0x06 04 00 41 The object can not be mapped into the PDO 0x06 04 00 42 The number and/or length of mapped objects would...
PDO)) Device Profile The BECKHOFF CANopen devices support all types of I/O communication, and correspond to the device profile for digital and analog input/output modules (DS401 Version 1). For reasons of backwards compatibility, the default mapping was not adapted to the DS401 V2 profile version.
Connection and cabling Connection and cabling CANopen connection The CAN bus line is connected via a 9-pin D-sub socket with the following configuration: Assignment not used CAN low (CAN-) CAN ground (internally connected to pin 6) not used Shield CAN ground (internally connected to pin 3) CAN high (CAN+) not used not used...
Connection and cabling Cabling CAN is a 2-wire bus system, to which all participating devices are connected in parallel (i.e. using short drop lines). The bus must be terminated at each end with a 120 (or 121) Ohm terminating resistor to prevent reflections.
Page 26
Connection and cabling Bus length The maximum length of a CAN bus is primarily limited by the signal propagation delay. The multi-master bus access procedure (arbitration) requires signals to reach all the nodes at effectively the same time (before the sampling within a bit period).
Page 27
Connection and cabling Drop lines Drop lines must always be avoided as far as possible, since they inevitably cause reflections. The reflections caused by drop lines are not however usually critical, provided they have decayed fully before the sampling time. In the case of the bit timing settings selected in the Bus Couplers it can be assumed that this is the case, provided the following drop line lengths are not exceeded: Baud rate Drop line length...
Page 28
Shorter drop line lengths must be maintained when passive distributors ("multiport taps"), such as the BECKHOFF ZS5052-4500 Distributor Box. The following table indicates the maximum drop line lengths and the maximum length of the trunk line (without the drop lines):...
Page 29
HF interference will be transmitted from the mounting rail to the screen of the bus cable. In that case the screen should not be attached to the couplers - it should nevertheless still be fully connected through. Cable colors Recommended application of Beckhoff CAN cables: Function ZB5100 cable color...
Connection and cabling Topology All devices are connected in parallel. The bus must be terminated at each end with a 120 ohm termination resistor. CANopen limits the number of devices per network to 64. The maximum possible network size is limited by the data rate. For sample, at 1 Mbit/s a network size of 20 m is possible, at 50 kbit/s a network size of 1000 m.
TwinCAT tabs TwinCAT tabs In TwinCAT, information and settings for the CANopen interface are added under tabs. The main TwinCAT tabs are described in this section. In addition, the section illustrates how the CANopen interface is displayed in the tree view under TwinCAT. The tree view and the tabs for a CANopen interface are identical under TwinCAT2 and TwinCAT3.
Page 32
PLC program. Double-click on a variable name in the tree view to open the link dialog. The link variables are identified with a small arrow icon. Further information about TwinCAT can be found in the TwinCAT documentation on the Beckhoff website: www.beckhoff.de Version: 1.0...
TwinCAT tabs CANopen master 4.2.1 General The General tab contains general information for a CANopen device, including name, type and ID. Description Name of the CANopen device CANopen device type Here you can add a comment (e.g. notes relating to the system component) Here you can disable the CANopen device Running No.
TwinCAT tabs 4.2.2 FC 51xx Description Name of the physical interface. Name and type of the CANopen device. Name of the CANopen master. Range between 1 and 127. Determines the identifier of the master heartbeat telegram. Ensure that it is not the same as a slave node address.
TwinCAT tabs 4.2.3 The CANopen master is an ADS device with its own Net ID, which can be modified here. All ADS services (diagnostics, acyclic communication) sent to the CANopen master must use this Net ID and port no. CXxxxx-M510/B510 Version: 1.0...
TwinCAT tabs CANopen slave 4.3.1 CAN node Version: 1.0 CXxxxx-M510/B510...
Page 37
TwinCAT tabs Description The address is set here. After CANopen, the parameter 0x1000 "Device Type" contains the number of the supported device profile in both the lowest value bytes. This number is entered here and compared with the parameter in the device on system startup.
TwinCAT tabs 4.3.2 SDOs The SDO tab is used to display/manage entries, which are sent to the node on startup. Description Object index entries in angle brackets were created automatically based on the current configuration. Further entries can be created and managed via "Append", "Insert", Delete" and "Edit".
TwinCAT tabs 4.3.3 This tab appears if you click on a process data object (PDO) in the tree view. Process Data Objects (PDOs) are CAN telegrams which transport process data without a protocol overhead. • RxPDOs are received by the device. •...
The Beckhoff FC510x PC cards are capable of synchronizing the CANopen bus system with the cycles of the application program (PLC or NC).
Page 41
Parameterization and commissioning The guaranteed reaction time under cyclic synchronous communication is always at least as long as the cycle time, and the bus bandwidth is not exploited optimally, since old data, i.e. data that has not changed, is continuously transmitted. It is however possible to optimize the network through the selection of different SYNC multiples (transmission types 1...240), so that data that changes slowly is transmitted less often than, for instance, time-critical inputs.
Page 42
The BECKHOFF FC510x PC cards indicate the bus loading via the System Manager. This variable can also be processed in the PLC, or can be displayed in the visualization system.
Parameterization and commissioning Parameterization with TwinCAT 2 This section illustrates how CANopen devices can be parameterized with the aid of TwinCAT 2. A total of three devices are used for the sample, including a CANopen master, to which two CANopen slaves are connected.
Page 44
Parameterization and commissioning 4. Type the host name or the IP address of the device into the Enter Host Name / IP box and press [Enter]. 5. Mark the device found and click on Add Route. The Logon Information window appears. 6.
Parameterization and commissioning 5.2.2 Add CANopen slave The sample shows a CX2020 CANopen slave with CX2500-B510 fieldbus module, connected to the CANopen master. In order to ensure that the CANopen slave is configured and subsequently detected by the CANopen master with all inputs and outputs, the CANopen slave first must be added in TwinCAT. Prerequisites for this step: •...
Parameterization and commissioning 5.2.3 Creating a virtual slave Additional virtual slaves can be created on the same hardware interface. This enables more data to be exchanged with a CANopen master, or a connection with a second CANopen master can be established. Each virtual slave is assigned a dedicated address via TwinCAT and is configured like an independent device for the CANopen master.
Parameterization and commissioning 5.2.4 Setting the address Once the CANopen slave was successfully added in TwinCAT, the address of the CANopen slave can be set. Devices with a DIP switch have a preset address. The address on the DIP switch must match the address set in TwinCAT.
Parameterization and commissioning 5.2.5 Creating further PDOs The CANopen slave can exchange up to 16 PDOs (each with 8 bytes of process data) with the CANopen master in input and output direction. By default 2 PDOs are created in Tx and Rx direction. Here we shown how to create further PDOs for a CANopen slave.
Parameterization and commissioning 5.2.6 Creating variables In TwinCAT the PDOs are filled with variables, which can later be linked with the PLC program. This section describes how to create variables. Prerequisites for this step: • Newly created PDOs, which are to be filled with variables. Create the variables as follows: 1.
Parameterization and commissioning 5.2.7 Setting the transmission type The transmission type determines how the process data objects are transferred. The transmission type for the RxPDOs and TxPDOs is set on the PDO tab. The available transmission types are: acyclic synchronous, cyclic synchronous, and asynchronous. Transmission type: Acyclic Synchronous Cyclic Synchronous...
Parameterization and commissioning 5.2.8 Creating a PLC project Use PLC Control to create a PLC project. The next steps describe how to create a PLC project in TwinCAT and add it in the tree view. Prerequisites for this step: • An Embedded PC, added in TwinCAT. Create a PLC project as follows: 1.
Page 52
Parameterization and commissioning Adding a PLC project The PLC project can be added in the System Manager. The newly created variables from a PLC project are integrated in the System Manager and can be linked with the inputs and outputs of the hardware. Prerequisites for this step: •...
Parameterization and commissioning 5.2.9 Linking variables Once the PLC project was successfully added in the System Manager, you can link the newly created input and output variables from the PLC project with the inputs and outputs of your devices. Prerequisites for this step: •...
Parameterization and commissioning 5.2.10 Load configuration to CX Once all variables are linked, the configuration can be saved and loaded on the CX. This has the advantage that the PLC project is loaded and started automatically when the CX is switched on. The start of the previously created PLC project can thus be automated.
Page 55
Parameterization and commissioning 7. In the tree view on the left click on PLC – Configuration, then on the PLC Settings (Target) tab. 8. Select the Start PLC under Boot Project and click on Apply. 9. Start PLC Control and open the PLC project. 10.
Parameterization and commissioning 5.2.11 Adding a CANopen master The CANopen master is added with the TwinCAT System Manager, like the other devices. The attached master can then be used to find all connected slaves. The following section illustrates how to add a CANopen master in TwinCAT.
Page 57
Parameterization and commissioning ð All devices and slave boxes that are found are displayed in the tree view on the left, including Bus Terminals connected to the devices or slave boxes. Repeat the steps if not all devices are displayed. If not all devices and slave boxes are found despite the repeat operation, check the cabling of the devices and slave boxes.
Parameterization and commissioning Parameterization with TwinCAT 3 This section illustrates how CANopen devices can be parameterized with the aid of TwinCAT 3. A total of three devices are used for the sample, including a CANopen master, to which two CANopen slaves are connected.
Page 59
Parameterization and commissioning 4. Type the host name or the IP address of the device into the Enter Host Name / IP box and press [Enter]. 5. Mark the device found and click on Add Route. The Logon Information window appears. Enter the user name and password for the CX in the User Name and Password fields and click OK.
Parameterization and commissioning 5.3.2 Add CANopen slave The sample shows a CX2020 CANopen slave with CX2500-B510 fieldbus module, connected to the CANopen master. In order to ensure that the CANopen slave is configured and subsequently detected by the CANopen master with all inputs and outputs, the CANopen slave first must be added in TwinCAT. Prerequisites for this step: •...
Parameterization and commissioning 5.3.3 Creating a virtual slave Additional virtual slaves can be created on the same hardware interface. This enables more data to be exchanged with a CANopen master, or a connection with a second CANopen master can be established. Each virtual slave is assigned a dedicated address via TwinCAT and is configured like an independent device for the CANopen master.
Parameterization and commissioning 5.3.4 Setting the address Once the CANopen slave was successfully added in TwinCAT, the address of the CANopen slave can be set. Devices with a DIP switch have a preset address. The address on the DIP switch must match the address set in TwinCAT.
Parameterization and commissioning 5.3.5 Creating further PDOs The CANopen slave can exchange up to 16 PDOs (each with 8 bytes of process data) with the CANopen master in input and output direction. By default 2 PDOs are created in Tx and Rx direction. Here we shown how to create further PDOs for a CANopen slave.
Parameterization and commissioning 5.3.6 Creating variables In TwinCAT the PDOs are filled with variables, which can later be linked with the PLC program. This section describes how to create variables. Prerequisites for this step: • Newly created PDOs, which are to be filled with variables. Create the variables as follows: 1.
Parameterization and commissioning 5.3.7 Setting the transmission type The transmission type determines how the process data objects are transferred. The transmission type for the RxPDOs and TxPDOs is set on the PDO tab. The available transmission types are: acyclic synchronous, cyclic synchronous, and asynchronous. Transmission type: Acyclic Synchronous Cyclic Synchronous...
Parameterization and commissioning 5.3.8 Creating a PLC project The next steps describe how to create a PLC project in TwinCAT and add it in the tree view. Prerequisites for this step: • A newly created TwinCAT XAE project. Create a PLC project as follows: 1.
Page 67
Parameterization and commissioning 5. In the tree view right-click on the PLC project, then click on Build in the context menu. ð You have successfully created a PLC project and added the project in TwinCAT. A PLC instance with the variables for the inputs and outputs is created from the PLC project.
Parameterization and commissioning 5.3.9 Linking variables Once the PLC project was successfully added in the System Manager, you can link the newly created input and output variables from the PLC project with the inputs and outputs of your hardware. Prerequisites for this step: •...
Parameterization and commissioning 5.3.10 Load configuration to CX Once variables are linked, the configuration can be saved and loaded on the CX. This has the advantage that the PLC project is loaded and started automatically when the CX is switched on. The start of the previously created PLC project can thus be automated.
Page 70
Parameterization and commissioning 7. In the context menu click on Autostart Boot Project. The setting is selected 8. Right-click on the project folder in the tree view. 9. In the context menu click on Auto Save to Target as Archive. The setting is selected.
Parameterization and commissioning 5.3.11 Adding a CANopen master The CANopen master is added with the TwinCAT System Manager, like the other devices. The attached master can then be used to find all connected slaves. The following section illustrates how to add a CANopen master in TwinCAT.
Page 72
Parameterization and commissioning ð All devices and slave boxes that are found are displayed in the tree view on the left, including Bus Terminals connected to the devices or slave boxes. Repeat the steps if not all devices are displayed. If not all devices and slave boxes are found despite the repeat operation, check the cabling of the devices and slave boxes.
Error handling and diagnostics Error handling and diagnostics Diagnostic LEDs The diagnostic LEDs of a CANopen master and CANopen slaves are described here. The labelling of the diagnostic LEDs on a CX2500 fieldbus module and an Embedded PC with optional interface is identical. The LED description therefore only distinguishes between CANopen master and CANopen slave.
Error handling and diagnostics Status messages The CANopen status messages provide additional information and can be used for diagnostic purposes. The following table shows which values the variables can assume: Inputs Meaning CycleInfo Cycle Counter: This counter is incremented by one after each cycle. Error: Shows the number of boxes, with a non-zero BoxState.
Error handling and diagnostics Communication In the tree view, input variables are listed under the Inputs menu item, which provide information about a CANopen device. The NodeState variable can be used to show the state of the CANopen communication, to indicate whether the slave is in data exchange or an error is present.
Error handling and diagnostics PDOs SendCounter TxPDOs feature an additional SendCounter variable under the Control menu item. The output variable is incremented by one whenever a PDO is sent. ReceiveCounter RxPDOs feature an additional ReceiveCounter variable under the Status menu item. The input variable is incremented by one whenever a PDO is received.
Appendix Appendix Accessories Cables and connectors for the connection of the CAN components. Cable Item number Description ZB5100 CAN cable, 4-core, fixed installation 2 x 2 x 0.25 mm², price per meter Connector Item number Description ZS1051-3000 Bus interface connector, D-sub for CANopen, in the housing, with switchable termination resistor ZS1052-3000 Bus interface connector, 5-pin for BK5xxx, in the...
All products of the Embedded PC family are CE, UL and EAC certified. Since the product family is continuously developed further, we are unable to provide a full listing here. The current list of certified products can be found at www.beckhoff.com. FCC Approvals for the United States of America...
Beckhoff's branch offices and representatives Please contact your Beckhoff branch office or representative for local support and service on Beckhoff products! The addresses of Beckhoff's branch offices and representatives round the world can be found on her internet pages: http://www.beckhoff.com You will also find further documentation for Beckhoff components there.
Need help?
Do you have a question about the CX-M510 Series and is the answer not in the manual?
Questions and answers