BECKHOFF Fieldbus Components

Documentation for

CX8030 and CX8031 - Embedded-PCs for PROFIBUS

CX8030: PROFIBUS Master

CX8031: PROFIBUS Slave

Version: 1.2.0
Date: 2015-07-29


Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with the applicable national standards.
It is essential that the following notes and explanations are followed when installing and commissioning these components.

The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.

Disclaimer

The documentation has been prepared with care. The products described are, however, constantly under development.
For that reason the documentation is not in every case checked for consistency with performance data, standards or other characteristics.
In the event that it contains technical or editorial errors, we retain the right to make alterations at any time and without warning.
No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.

Trademarks

Beckhoff®, TwinCAT®, EtherCAT®, Safety over EtherCAT®, TwinSAFE®, XFC® and XTS® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.

Patent Pending

The EtherCAT Technology is covered, including but not limited to the following patent applications and patents:
EP1590927, EP1789857, DE102004044764, DE102007017835
with corresponding applications or registrations in various other countries.

The TwinCAT Technology is covered, including but not limited to the following patent applications and patents:
EP0851348, US6167425 with corresponding applications or registrations in various other countries.

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.


Safety instructions

Safety rules

Consider the following safety instructions and descriptions!
Product specific safety instructions are to be found on the following pages or in the areas mounting, wiring, commissioning etc.

Disclaimer

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 the use of trained specialists in control, automation and drive engineering who are familiar with the applicable national standards.

Description of symbols

The following symbols with a adjoining safety advise or notice are used in this documentation. You have to read the safety advices carefully and adhere them strictly!

DANGER 		Acute risk of injury!
If you do not adhere the safety advise adjoining this symbol, there is immediate danger to life and health of individuals!

WARNING 		Risk of injury!
If you do not adhere the safety advise adjoining this symbol, there is danger to life and health of individuals!

CAUTION 		Hazard to individuals!
If you do not adhere the safety advise adjoining this symbol, there is obvious hazard to individuals!

Attention 		Hazard to devices and environment
If you do not adhere the notice adjoining this symbol, there is obvious hazard to materials and environment.

Note 		Note or pointer
This symbol indicates information that contributes to better understanding.


CX8030, CX8031 - Documentation issue status

BECKHOFF CX8030, CX8031: Foreword

Documentation issue status

Version Comment
1.2.0
  • Chapter 1-second UPS added
  • Chapter Operating System added
1.1.0
  • Foreword updated
  • CX8030 added
1.0.0
  • First release
0.0.0
  • Preliminary Version (German only)

Image Version CX8030

Firmware Description
Build 2240
  • Release version (requires TC2.11 Build 2240)

Image Version CX8031

Firmware Description
Build 2240
  • Release version (requires TC2.11 Build 2240)
Build 2233
  • First Version


CX80xx - System overview

CX80xx is a device family of programmable controllers with 32-bit ARM-based CPU, which can be used for processing of PLC programs or as slave devices for higher-level fieldbus systems. Unlike with the non-programmable EtherCAT couplers of the EK series, which only act as gateway between the associated fieldbus system and the connected EtherCAT terminals, the CX80xx is programmable and able to run its own control program.

The devices from the CX80xx series represent a further development of the well-known and proven 16-bit microcontroller-based Bus Terminal Controllers from the BC and BX series including more efficient 32-bit processors. As with the BC/BX, it is also ensured in the case of the CX80xx that the control and the local program continue to be executed in the case of interruption of the higher-level fieldbus system. The CX80xx devices can therefore be used as local controllers. Alternatively, Bus Terminals (K-bus) or EtherCAT Terminals (E-bus) can be connected; the CX80xx automatically recognizes which terminals are connected during the start-up phase. The use of EtherCAT gives rise to further options, such as the realization of different topologies, the integration of further bus systems such as CANopen, PROFIBUS and PROFINET and – with the EtherCAT Box Modules – connection to the IP67 world.

Like all CX products, the CX80xx devices are programmed and commissioned via the Ethernet interface, which can, of course, also be used for connection of the control system with a regular network. Some of the Embedded PCs have further Ethernet interfaces with switch functions, so that a linear “daisy chain” topology can be constructed inexpensively, without additional hardware. The other connections on the lower plug level are fieldbus-specific. Under the cover at the upper housing level there is an exchangeable button cell for date and time, a set of DIP switches for setting function modes, a slot for Micro-SD Flash memory cards and a type B USB connection. Thanks to their low power consumption, the devices are fanless.

Microsoft Windows CE is used as the operating system. In the absence of a monitor port, the operating system and its “virtual” display can only be accessed via the network. As for all other Beckhoff devices, the TwinCAT software is used for system configuration and the programming of the PLC functionality. The CX80xx target device features a pre-installed TwinCAT PLC runtime environment. All software required for operating the device, including the operating system, the TwinCAT files and user files and data, is stored on the Micro SD Flash card. This simplifies exchange in the case of service. Commercial card readers can be used to access the card data. The size of the Micro SD Flash card (e.g. 512 MB) can be chosen depending on the application and the quantity of data to be stored.

The CX80xx device family features an integrated, capacitive 1-second UPS, which in the event of a failure of the supply voltage provides sufficient energy for saving persistent data. Important data are thus preserved in a non-volatile manner without battery backup.

With a high-performance but nevertheless energy-saving 32-bit ARM processor, EtherCAT as I/O bus and TwinCAT PLC with extensive PLC libraries, the Embedded Controllers from the CX80xx series represent high-performance and versatile controllers with slave fieldbus connection.

Fieldbus-interface

The variants from the CX80xx series differ by their fieldbus interfaces. Various versions cover the most important fieldbus systems:

  • CX8010: EtherCAT Slave
  • CX8030: PROFIBUS DP Master
  • CX8031: PROFIBUS DP Slave
  • CX8050: CAN Master
  • CX8051: CANopen Slave
  • CX8080: RS232/485
  • CX8090: Ethernet (RT-Ethernet, EAP, ModbusTCP, TCP/IP, UDP/IP, Web Services)
  • CX8091: BACnet IP/OPC UA
  • CX8093: PROFINET RT Device (Slave)
  • CX8095: Ethernet/IP Slave
  • CX8097: Sercos III Slave

Programming

The CX80xx controller is programmed according to the high-performance IEC 61131-3 standard. As with all other Beckhoff controllers, the TwinCAT automation software is the basis for parameterization and programming. Users therefore have the familiar TwinCAT tools available, e.g. PLC programming interface, System Manager and TwinCAT Scope.

Configuration

The configuration is also carried out using TwinCAT. The fieldbus interface and the real-time clock can be configured and parameterized via the System Manager. The System Manager can read all connected devices and Bus Terminals. The configuration is stored on the CX after the parameterization. The configuration thus created can be accessed again later.


CX803x - Introduction

BECKHOFF CX803x: Product overview

CX8030, CX8031 - Introduction

In the basic version the CX80xx contains a 512 MB MicroSD card. A fieldbus interface, an Ethernet interface and a K-bus or E-bus interface are included as standard.

The smallest task time to be used is 1 ms (a task time of 1 to 50 ms is recommended for the I/O data, further tasks can also be set slower). When using shorter cycle times, the total system load is to be observed. If too short a cycle time is selected, the Web visualization and remote desktop may operate very slowly or cause timeouts. The user is responsible for projecting and configuring his system such that it is not overloaded.

CX8030

The CX8030 is a controller with an Ethernet connection, via which it is programmed and/or configured, and a PROFIBUS master interface on an RS485 basis with a D-sub connection. Optionally, the CX8030 can also be operated as a PROFIBUS slave.

Alternatively K-bus or E-bus terminals can be series-connected; the CX8030 automatically detects which type of terminal is connected during the start-up phase. The controller is programmed with TwinCAT via the Ethernet interface.

CX8031

The CX8031 is a controller with an Ethernet connection, via which it is programmed and/or configured, and a PROFIBUS interface on an RS485 basis with a D-sub connection. Physically the CX8031 has only one D-sub interface, but this can be used in such a way that it appears as if 4 devices are on the bus. The advantage of this is that more data can be exchanged and that the CX8031 can communicate as a DP/DP coupler with a second PROFIBUS master.

Alternatively K-bus or E-bus terminals can be series-connected; the CX8031 automatically detects which type of terminal is connected during the start-up phase. The controller is programmed with TwinCAT via the Ethernet interface.


CX803x - Technical data

BECKHOFF CX803x: Product overview

Technical data

Technical data | CX8030 | CX8031
Processor | 32 bit, 400 MHz, ARM9
Internal main memory | 64 MB RAM (internal, not extendable)
Operating system | Microsoft Windows CE 6.0
Web-based Management | yes
Flash memory | MicroSD card (ATP) 512 MB (optionally 1, 2, 4 GB)
Interfaces | 1 x USB device (behind the front flap) 1 x RJ45 Ethernet, 10/100 MBit/s (ADS over TCP/IP) 1 x D-sub RS485 PROFIBUS
Protocols | PROFIBUS Master (Slave Mode optional) | PROFIBUS slave
Interface for I/O terminals | K-bus or E-bus, automatic recognition
Process data on the K-bus | max. 2 KB input data max. 2 KB output data
Diagnostics LED | 1 x power, 1 x TC status, 2 x bus status
Clock | internal battery-backed clock (RTC) for time and date (battery exchangeable)
Operating system | Microsoft Windows CE
Control software | TwinCAT PLC runtime (from version 2.11 R3)
Programming | TwinCAT PLC
Programming languages | IEC 61131-3
Online Change | Yes
Up/download code | Yes/Yes
Power supply | 24 VDC (-15 %/+20 %)
UPS | 1-second UPS
Power supply for I/O terminals | max. 2 A
Max. power loss | 3.0 W (including system interfaces)
Dielectric strength | 500 V (supply / internal electronics)
Dimensions (W x H x D) | 64 mm x 100 mm x 73 mm
Weight | approx. 180 g
Permissible ambient temperature during operation | 0° C ... +55° C
Permissible ambient temperature during storage | -25° C ... +85° C
Installation position | See chapter Installation positions
Relative humidity | 95 % no condensation
Vibration / shock resistance | according to EN 60068-2-6 / EN 60068-2-27
EMC immunity/emission | according to EN 61000-6-2 / EN 61000-6-4
Protection class | IP20
System data | PROFIBUS (CX8030, CX8031)
Number of I/O modules | 100 with repeater
Number of I/O points | approx. 6.000, depending on the master
Transmission medium | screened copper cable, 2 x 0.25 mm²
Cable length | 1200 m | 1000 m | 400 m | 200 m | 100 m
Data transfer rate | 9.6/19.2/93.75 kbaud | 187.5 kbaud | 500 kbaud | 1500 kbaud | 3 /6 /12 Mbaud
Topology | Line topology


CX803x - Technical data - PROFIBUS

BECKHOFF CX8030: Product overview

Technical data - PROFIBUS

Technical data - PROFIBUS | CX8030
Number of slaves | 125 with repeaters
Quantity of data per slave | 244 bytes of input data and 244 bytes of output data
Bus interface | D-sub, 9-pin
Baud rate | 9.6k; 19.2k; 93.75k; 187.5k; 500k; 1.5M; 3M; 6M; 12 Mbaud
Protocol |
PROFIBUS DP | Yes
PROFIBUS FMS | No
ADS Interface | Yes (only via Ethernet)
Services |
PROFIBUS | DP
DPV1 class 1 | Yes
DPV1 class 2 | No
DPV2 MC | No
Maximum process data | limited only by memory
Redundancy | No
Muti Master | No
FDL | No
S5 AG-AG | No
Activating slaves via ADS | Yes
Car | No
Diagnosis/Status/Alarm |
TC LED | Yes, green/red
BF LED | Yes, green/red
DIA LED | Yes, green/red (no function)

CX8030 as slave

The CX8030 can also be configured as a slave. Unlike the CX8031, where 3 virtual slaves are available, only one real slave can be used. The CX8030 can operate either as a master or as a slave, but not both at the same time.

Technical data - PROFIBUS | CX8030
Number of slaves | 1
Quantity of data per slave | 240 bytes of input data and 240 bytes of output data
Bus interface | D-sub, 9-pin
Baud rate | max. 12 Mbaud


CX8031 - Technical data - PROFIBUS

BECKHOFF CX8031: Product overview

Technical data - PROFIBUS

Technical data Ethernet | CX8031
Number of slaves | 4 (of which 3 virtual)
Quantity of data per slave | 240 bytes of input data and 240 bytes of output data
Bus interface | D-sub, 9-pin
Baud rate | max. 12 Mbaud
Autobaud | Yes
Protocol |
PROFIBUS DP slave | Yes
PROFIBUS-DP (virtual slave) | 3 (see virtual PROFIBUS device)
ADS Interface | yes (only via Ethernet)
Services |
PROFIBUS | DP
DPV1 | Yes
Diagnosis/Status/Alarm |
TC LED | Yes, green/red
BF LED | Yes, green/red
DIA LED | Yes, green/red
Diagnostic messages | Yes


CX80xx - MicroSD cards

BECKHOFF CX80xx: Product overview

Micro SD cards

In the basic version the CX80xx contains a MicroSD card with 512 MB. You can order it as an option with larger cards (up to 4 GB).

The cards employed are SLC memory with extended temperature range for industrial applications. Use exclusively MicroSD cards approved by Beckhoff.

Example of a MicroSD card:

Order designation | Capacitance | Description
CX1900-0123 | 1 GB | MicroSD card (SLC memory) with extended temperature range for industrial applications instead of the 512 MB card (ordering option)
CX1900-0125 | 2 GB
CX1900-0127 | 4 GB
CX1900-0122 | 512 MB | MicroSD card (SLC memory) with extended temperature range for industrial applications as spare part.
CX1900-0124 | 1 GB
CX1900-0126 | 2 GB
CX1900-0128 | 4 GB

Further Information: http://www.beckhoff.com/CX8000


CX80xx - Dimensions

BECKHOFF CX80xx: Mounting and wiring

Dimensions

The following drawings show the dimensions of the CX80xx Embedded PCs.

Dimensions

Drawings in several CAD formats can be found at: http://www.beckhoff.com/english.asp?download/cx1000.htm


CX80xx - Installation on mounting rails

BECKHOFF CX80xx: Mounting and wiring

Installation on mounting rails

Snapping onto the mounting rail

The CX80xx can simply be snapped onto the mounting rail. To this end simply position the block on the mounting rail and push it slightly until it engages on the right-hand side. The is indicated by a distinct click. Use a screwdriver to push up the lock on the left-hand side, thereby turning it and causing it to engage audibly.

Attention 		Avoid damage!
Do not force the module or apply excessive pressure!

Permissible installation positions and minimum distances

Installation position up to 55 °C

Attention 		Comply with the permitted installation position and minimum distances!
The maximum ambient temperature for CPU modules mounted on a top-hat rail is 55°C. The orientation in which the device is fitted must be selected in such a way that cooling air can flow vertically through the ventilation holes. The images show the permitted and two incorrect installation positions.

Mounting must provide a clearance of 30 mm both above and below a CX80xx device combination to ensure adequate ventilation of the base CPU module and the power supply unit.

The high performance and the compact design of the CX80xx systems may result in increased heat generation. The heat is dissipated via a passive ventilation system. This system requires the unit to be mounted correctly. Ventilation openings are located at the top and bottom of the housing. The system therefore has to be installed horizontally. This ensures optimum air flow.

Installation positions with reduced temperature range up to 45°C

Other installation positions are permitted with a temperature range up to 45°C.


CX80xx - Power supply

BECKHOFF CX80xx: Mounting and wiring

Power supply

WARNING 		Risk of electric shock and damage of device!
Bring the CX80xx into a safe, powered down state
before starting installation, disassembly or wiring!

This power supply unit is equipped with an I/O interface, which permits connection of the Beckhoff Bus Terminals. The power is supplied via the upper spring-loaded terminals with the designation 24 V and 0 V.

The supply voltage supplies the CX system and, via the terminal bus, the Bus Terminals with a voltage of 24 VDC (15 %/+20 %). The dielectric strength of the power supply is 500 V. Since the Terminal Bus (K- and E-bus) only transfers data, a separate power supply is required for the Bus Terminals. This is provided by means of the power contacts, which are not connected to the power supply. The maximum current load of the power contacts is 10 A.

Requirements for the power supply (24 V)

In order to guarantee the operation of the CPU (CX80xx module) and the terminal strand in all cases, the power supply must supply 2.0 A at 24 V.

LED

If the power supply unit is connected correctly and the power supply is switched on, the two upper LEDs in the terminal prism are green. The left LED (Us) indicates the CPU supply. The right LED (Up) indicates the terminal supply. The other LEDs indicate the Terminal Bus status. A detailed description of the LEDs can be found in section “LED troubleshooting”.

Power contact PE

CAUTION 		Power contact PE
The PE power contact must not be used for other potentials.


CX80xx, EK9xxx - Ethernet connections

BECKHOFF CX80xx, EK9xxx: Ethernet

Ethernet connections

Assignment of the RJ45 interface, port 1

X001

PIN | Signal | Description
1 | TD + | Transmit +
2 | TD - | Transmit -
3 | RD + | Receive +
4 | connected | reserved
5
6 | RD - | Receive -
7 | connected | reserved
8

Assignment of the RJ45 interface, port 2 (switched)

CX8010, CX809x: X101 / 102
EK9xxx: X001 / X002

PIN | Signal | Description
1 | TD + | Transmit +
2 | TD - | Transmit -
3 | RD + | Receive +
4 | connected | reserved
5
6 | RD - | Receive -
7 | connected | reserved
8


Ethernet Cable

Transmission standards

10Base5

The transmission medium for 10Base5 consists of a thick coaxial cable ("yellow cable") with a max. transmission speed of 10 MBaud arranged in a line topology with branches (drops) each of which is connected to one network device. Because all the devices are in this case connected to a common transmission medium, it is inevitable that collisions occur often in 10Base5.

10Base2

10Base2 (Cheapernet) is a further development of 10Base5, and has the advantage that the coaxial cable is cheaper and, being more flexible, is easier to lay. It is possible for several devices to be connected to one 10Base2 cable. It is frequent for branches from a 10Base5 backbone to be implemented in 10Base2.

10BaseT

Describes a twisted pair cable for 10 MBaud. The network here is constructed as a star. It is no longer the case that every device is attached to the same medium. This means that a broken cable no longer results in failure of the entire network. The use of switches as star couplers enables collisions to be reduced. Using full-duplex connections they can even be entirely avoided.

100BaseT

Twisted pair cable for 100 MBaud. It is necessary to use a higher cable quality and to employ appropriate hubs or switches in order to achieve the higher data rate.

10BaseF

The 10BaseF standard describes several optical fiber versions.

Short description of the 10BaseT and 100BaseT cable types

Twisted pair copper cable for star topologies, where the distance between two devices may not exceed 100 meters.

UTP

Unshielded twisted pair
This type of cable belongs to category 3, and is not recommended for use in an industrial environment.

S/UTP

Screened/unshielded twisted pair (screened with copper braid)
Has a general screen of copper braid to reduce influence of external interference. This cable is recommended for use with Bus Couplers.

FTP

Foiled shielded twisted pair (screened with aluminum foil)
This cable has an outer screen of laminated aluminum and plastic foil.

S/FTP

Screened/foiled-shielded twisted pair (screened with copper braid and aluminum foil)
Has a laminated aluminum screen with a copper braid on top. Such cables can provide up to 70 dB reduction in interference power.

STP

Shielded twisted pair
Describes a cable with an outer screen, without defining the nature of the screen any more closely.

S/STP

Screened/shielded twisted pair (wires are individually screened)
This identification refers to a cable with a screen for each of the two wires as well as an outer shield.

ITP

Industrial Twisted-Pair
The structure is similar to that of S/STP, but, in contrast to S/STP, it has only one pair of conductors.


BECKHOFF Profibus Cabling

BECKHOFF Fieldbus Components: Mounting and Wiring

PROFIBUS Cabling

Physical aspects of the data transmission are defined in the PROFIBUS standard (see PROFIBUS layer 1: Physical Layer).

The types of area where a fieldbus system can be used is largely determined by the choice of the transmission medium and the physical bus interface. In addition to the requirements for transmission security, the expense and work involved in acquiring and installing the bus cable is of crucial significance. The PROFIBUS standard therefore allows for a variety of implementations of the transmission technology while retaining a uniform bus protocol.

Cable-based transmission

This version, which accords with the American EIA RS-485 standard, was specified as a basic version for applications in production engineering, building management and drive technology. A twisted copper cable with one pair of conductors is used. Depending on the intended application area (EMC aspects should be considered) the screening may be omitted.

Two types of conductor are available, with differing maximum conductor lengths (see the RS-485 table).

RS485 - Fundamental properties
RS-485 transmission according to the Profibus standard
Network topology | Linear bus, active bus terminator at both ends, stubs are possible.
Medium | Screened twisted cable, screening may be omitted, depending upon the environmental conditions (EMC).
Number of stations | 32 stations in each segment with no repeater. Can be extended to 127 stations with repeater
Max. bus length without repeater | 100 m at 12 MBit/s 200 m at 1500 KBit/s, up to 1.2 km at 93.75 KBit/s
Max. bus length with repeater | Line amplifiers, or repeaters, can increase the bus length up to 10 km. The number of repeaters possible is at least 3, and, depending on the manufacturer, may be up to 10.
Transmission speed (adjustable in steps) | 9.6 kBit/s; 19.2 kBit/s; 93.75 kBit/s; 187.5 kBit/s; 500 kBit/s; 1500 kBit/s; 12 MBit/s
Plug connector | 9-pin D-Sub connector for IP20 M12 round connector for IP65/67

Cabling for PROFIBUS DP and PROFIBUS FMS

Note the special requirements on the data cable for baud rates greater than 1.5 MBaud. The correct cable is a basic requirement for correct operation of the bus system. If a simple 1.5 Mbaud cable is used, reflections and excessive attenuation can lead to some surprising phenomena. It is possible, for instance, for a connected PROFIBUS station not to achieve a connection, but for it to be included again when the neighboring station is disconnected. Or there may be transmission errors when a specific bit pattern is transmitted. The result of this can be that when the equipment is not operating, PROFIBUS works without faults, but that there are apparently random bus errors after start-up. Reducing the baud rate (< 93,75 kBaud) corrects this faulty behavior.

If reducing the baud rate does not correct the error, then in many cases this can indicate a wiring fault. The two data lines maybe crossed over at one or more connectors, or the termination resistors may not be active, or they may be active at the wrong locations.

Note 		Pre-assembled cables from Beckhoff
Installation is made a great deal more straightforward if pre-assembled cables from Beckhoff are used! Wiring errors are avoided, and commissioning is more rapidly completed. The Beckhoff range includes fieldbus cables, power supply cables, sensor cables and accessories such as terminating resistors and T-pieces. Connectors and cables for field assembly are nevertheless also available.

Note 		Termination resistors
In systems with more than two stations all devices are wired in parallel. It is essential that the bus cables are terminated with resistors at the conductor ends in order to avoid reflections and associated transmission problems.

Distances

The bus cable is specified in EN 50170. This yields the following lengths for a bus segment.

Baud rate in kbits/sec | 9.6 | 19.2 | 93.75 | 187.5 | 500 | 1500 | 12000
Cable length in m | 1200 | 1200 | 1200 | 1000 | 400 | 200 | 100

Stubs up to 1500 kbaud <6.6 m; at 12 Mbaud stub segments should not be used.

Bus segments

A bus segment consists of at most 32 devices. 126 devices are permitted in a PROFIBUS network. Repeaters are required to refresh the signal in order to achieve this number. Each repeater is counted as one device.

IP-Link is the subsidiary bus system for Fieldbus Boxes, whose topology is a ring structure. There is an IP master in the coupler modules (IP230x-Bxxx or IP230x-Cxxx) to which up to 120 extension modules (IExxxx) may be connected. The distance between two modules may not exceed 5 m. When planning and installing the modules, remember that because of the ring structure the IP-Link master must be connected again to the last module.

Installation guidelines

When assembling the modules and laying the cables, observe the technical guidelines provided by the PROFIBUS User Organization (PROFIBUS Nutzerorganisation e.V.) for PROFIBUS DP/FMS (see www.profibus.com).

Checking the PROFIBUS wiring

A PROFIBUS cable (or a cable segment when using repeaters) can be checked with a few simple resistance measurements. The cable should meanwhile be removed from all stations:

  1. Resistance between A and B at the start of the lead: approx. 110 Ohm
  2. Resistance between A and B at the end of the lead: approx. 110 Ohm
  3. Resistance between A at the start and A at the end of the lead: approx. 0 Ohm
  4. Resistance between B at the start and B at the end of the lead: approx. 0 Ohm
  5. Resistance between screen at the start and screen at the end of the lead: approx. 0 Ohm

If these measurements are successful, the cable is okay. If, in spite of this, bus malfunctions still occur, this is usually a result of EMC interference. Observe the installation notes from the PROFIBUS User Organization (www.profibus.com).


PROFIBUS Connection

M12 circular connector

The M12 socket is inverse coded, and has five pins. Pin 1 is 5 VDC and 3 is GND for the active termination resistor. These must never be misused for other functions, as this can lead to destruction of the device.

Pin 2 and pin 4 are the PROFIBUS signals. These must never be swapped over, as this will prevent communication. Pin 5 is the shield, and this is capacitatively coupled to the Fieldbus Box chassis.

M12 socket pin assignment (-B310)

M12 socket/plug pin assignment (-B318)

Nine pole D-Sub

Pin 6 is 5 VDC und Pin 5 is GND for the active termination resistor. These must never be misused for other functions, as this can lead to destruction of the device.

Pin 3 and pin 8 are the PROFIBUS signals. These must never be swapped over, as this will prevent communication.

D-Sub socket pin assignment

PROFIBUS conductor colors

PROFIBUS conductors | M12 | D-Sub
B red | Pin 4 | Pin 3
A green | Pin 2 | Pin 8

Connection of Fieldbus Box modules

The connection of the Fieldbus Box modules is done direct or via a T-piece (or Y-piece).

The B318 series does have a male and female connector, that means no external T-piece is required. The supply voltage (+5VDC) for the termination resistor is only supplied via the female M12 connector. The termination resistor ZS1000-1610 is only available with male connector.

Therefore the incoming PROFIBUS line should end in a female connector.

Two T-pieces are available:

  • ZS1031-2600 with +5VDC on male and female connector for the termination resistor
  • ZS1031-2610 with +5VDC only on the female connector


CX80xx - Changing the battery

BECKHOFF CX80xx: Mounting and wiring

Changing the battery

The battery of the CX80xx is required for the real-time clock (RTC) of the CX80xx. It ensures that the RTC continues to run in the power-off state so that the set time is available again on restarting.

  • Step 1: Open the flap
  • Step 2/3: Take a small flat-blade screwdriver, insert it above the battery and prize the battery carefully out of the device
  • Step 4: Insert the new battery. The plus pole must be on the left
  • Step 5: Close the flap again
Battery type | Technical data
Duracell 303/357 SR44 | 1,5 V / 165 mAh

Note 		Battery maintenance

The battery must be replaced every 5 years.

Spare batteries can be ordered from Beckhoff Service.

Attention 		An incorrectly inserted battery may explode!

Use exclusively the specified battery type.

Make absolutely sure that positive and negative terminals of the battery are inserted correctly. (plus pole on the left)

Never open the battery or throw it into a fire.

The battery cannot be recharged.


CX8031 – DIP switch

BECKHOFF CX8031: Parameterization and commissioning

DIP switch

2x 10-pole address switch S101/S102

Address selector can be employed for the use of the PROFIBUS address.

S101 for the address x 1, S102 for the address x10, example S101=2, S102=3 PB address 32

So that the address is also used via the address selector, this must be activated in the System Manager.

The station address can now be set for each slave with a DIP switch + number. For the virtual slaves you can use +1, +2, +3 for example.

2-pole DIP switch (under the flap between the battery and the SD card slot)

DIP switch (red) | Meaning
1 off and 2 off | normal mode, TwinCAT is started
1 on and 2 off | The CX mode starts in Config Mode; the flash memory or, in the case of the CX80xx the SD card, is reachable via the USB interface (for example for an image update).
1 off and 2 on | Restore the registry
1 on and 2 on | No function so far


CX8031 - IP address

BECKHOFF CX8010, CX803x, CX805x, CX8080: Parameterization and commissioning

IP address

The CX8010, CX803x, CX805x and CX8080 have an Ethernet interface, X001.

X001

IP addressing via the operating system; default is DHCP (represented in the operating system as FEC1)

EtherCAT interface

The EtherCAT interface is a further Ethernet interface that is not visible in the operating system for the IP addressing.


CX8031, CX8051 – Setting the address via DHCP server

BECKHOFF CX8031, CX8051: Parameterization and commissioning

Setting the address via DHCP server

Port 1 (X001) is set to DHCP by default.

If DHCP is switched on, the CX is automatically assigned an IP address by the DHCP server. The DHCP server must know the MAC ID of the Bus Terminal Controller for this. The IP address should be assigned statically by the DHCP server. A local IP address is used if no DHCP server is reachable.

The DNS name is formed from the type and the last 3 byte of the MAC ID. The MAC ID is given on the production label of the Bus Terminal Controller.

Example: CX80xx
  • MAC ID: 00-01-05-01-02-03
  • DNS name: CX-010203


CX80xx - Subnet mask

BECKHOFF CX80xx : Parameterizing and comissioning

Subnet mask

The subnet mask is subject to the control of the network administrator, and specifies the structure of the subnet.

Small networks without a router do not require a subnet mask. The same is true if you do not use registered IP numbers. A subnet mask can be used to subdivide the network with the aid of the mask instead of using a large number of network numbers.

The subnet mask is a 32-bit number:

  • Ones in the mask indicate the subnet part of an address space.
  • Zeros indicate that part of the address space which is available for the host IDs.
Description | Binary representation | Decimal representation
IP address | 10101100.00010000.00010001.11001000 | 172.16.17.200
Subnet mask | 11111111.11111111.00010100.00000000 | 255.255.20.0
Network ID | 10101100.00010000.00010000.00000000 | 172.16.16.0
Host ID | 00000000.00000000.00000001.11001000 | 0.0.1.200

Standard subnet mask

Address class | Standard subnet mask (decimal) | Standard subnet mask (hex)
A | 255.0.0.0 | FF.00.00.00
B | 255.255.0.0 | FF.FF.00.00
C | 255.255.255.0 | FF.FF.FF.00

Note 		Assignment of subnets, host numbers and IP addresses

Neither subnet 0 nor the subnet consisting only of ones may be used.

Neither host number 0 nor the host number consisting only of ones may be used!

If the IP address is set using the KS2000 configuration software, it is necessary for the subnet mask also to be changed with the KS2000 configuration software.

If ARP addressing is used, the associated standard subnet mask, based on the IP address, is entered.

Under BootP or DHCP the subnet mask is transmitted also by the server.


CX80xx - Operating system

The CX80xx comes with a Microsoft CE operating system, version 6.0. This operating system is adapted and optimized for the CX80xx. Not all CE6.0 components are available.

Safety

From image version 3.54b security was tightened. This applies to CERHOST and TELNET. Both services are now switched off in delivery state. To reactivate these services, you need a Micro SD card reader.

CERHOST

CERHOST is deactivated by current images on first start-up via the registry file CeRemoteDisplay_Disable.reg, which is located in the folder RegFiles.

To reactivate CERHOST, delete the file CeRemoteDisplay_Disable.reg from the folder RegFiles and also the folder Documents and Settings.
Then reinsert the Micro SD card in the CX and reboot. The CX creates a new Document and Settings directory and then reboots automatically.
The CX is then accessible again via CERHOST.

TELNET

TELNET is deactivated by current images on first start-up via the registry file Telnet_Disable.reg, which is located in the folder RegFiles.

To reactivate TELNET, delete the file Telnet_Disable.reg from the folder RegFiles and also the folder Documents and Settings.
Then reinsert the Micro SD card in the CX and reboot. The CX creates a new Document and Settings directory and then reboots automatically.
The CX is then accessible again via TELNET.

IMAGE

If you do not know what image is loaded on the CX80xx, you can determine it quite easily.

  • Via the web diagnostics page of the CX. Here you can find the build number under the TwinCAT device.
    Opening the web diagnostics page:
    - IP address</config
    or
    - CX name/config
    Example:
    - 172.16.17.201/config
    or
    - CX-01551E/config
  • Via a Micro SD card reader.
    The Micro SD card contains a file with the name of the image.
    Example CX8000_CE600_LF_v354b_TC211R3_B2248.
    TC211R3_2248 indicates the TwinCAT build; in the example the build is 2248.
Feature / platform | CX80x0 LF version 3.xx
ATL | Xtd
MFC | X
XML DOM | X
COM | X
COM Storage | -
Winsock | X
TCP/IP | X
TCP/IPv6 | -
Firewall | X
Network Utilities (IpConfig, Ping, Route) | X
UPnP |
Control Point | -
Device Host | X
SOAP |
Client | -
Server | -
DCOM | -
Object Exchange Protocol OBEX | -
Message Queuing MSMQ | -
Server |
File Server (SMB/CIFS) | X
File Server | X
Print-Server (SMB/CIFS) | -
RAS Server / PPTP Server | -
Simple Network Management Protocol (SNMP) | X
Telnet Server | X
HTTP / ASP / FTP / SNTP -Server | X
Web Server (HTTPD) / Active Server Pages (ASP) Support / JScript 5.6 / VBScript 5.6 | X
Simple Network Time Protocol (SNTP) | X
HTML / DHTML, TLS, ISAPI extensions | X
Internet Explorer 6.0 | -
Java Applets | -
NET Compact Framework | v3.5
RDP Client (Remote Desktop protocol) | -
CAB File Installer/Uninstaller | X
TwinCAT (Level PLC) | X
USB support | X
Printer, storage on Compact Flash, for example | -
HID (Human interface devices) | -
Touch | -


CX80xx - K-Bus interface

BECKHOFF CX80xx: Parameterization and commissioning

K-Bus interface

It is possible to operate K-Bus terminals on the CX80xx.

The CX80xx recognizes these terminals automatically on scanning, reads out the terminal types and automatically places them in the System Manager.

Fig. K-Bus interface

K-Bus state

The K-Bus status is saved in the state byte (see fig. K-bus interface “1”). If the value is 0 the K-Bus is operating synchronously and without errors. If the value should be <>0 this can be an error, but it may also be just a notice that, for example, the K-bus requires longer than the employed task and is thus no longer synchronous to the task. The task time should be faster than 100 ms. We recommend a task time of less than 50 ms. The K-Bus update time typically lies between one and five ms.

Bit 0 = K-Bus Err
Bit 1 = Terminal State Err
Bit 2 = Process Data Length Err
Bit 8 = No valid Inputs
Bit 9 = K-Bus Input Update busy
Bit 10 = K-Bus Output Update busy
Bit 11 = Watchdog Err
Bit 15 = Acyc. Function active (e.g. K-Bus Reset)

If there is a K-bus error, this can be reset via the IOF_DeviceReset function block (in the TcIoFunctions.lib).

The NetID is that of the CX80xx and can thus be entered as an empty string, the Device ID (see fig. K-bus Interface “2”) is to be taken from the System Manager.


CX80xx - E-Bus interface

The operation of E-Bus terminals and EtherCAT devices is possible on the CX80xx.

The CX80xx recognizes these terminals automatically on scanning, reads out the terminal types and automatically places them in the System Manager.

Hinweis 		DC Distributed-Clocks
The CX80xx series is not suitable for the use of EtherCAT slaves that need the distributed clock functionality.


CX8030 - PROFIBUS interface

BECKHOFF CX8030: Parameterization and commissioning

PROFIBUS Interface

PROFIBUS communication takes place via the D-sub port X101. The CX8030 supports the automatic slave scanning function. To this end the GSD file must be stored in the folder \TwinCAT\IO\PROFIBUS.

Note 		No ADS via PROFIBUS
The CX8030 does not support the ADS via PROFIBUS. The program download and debugging can take place exclusively via the Ethernet interface.

PROFIBUS address (only in slave mode)

The PROFIBUS address can be assigned using the DIP switch or permanently assigned in the System Manager. If the address is permanently defined, the address switch is ignored (see DIP switch).

GSD file

The GSD file for PROFIBUS devices should be stored in the TwinCAT folder \TwinCAT\IO\PROFIBUS.

DpState

You can display the status of the PROFIBUS communication via the DpState and ascertain whether the slave is exchanging data (DpState=0) or whether there is an error or a problem.

0 = No error
1 = Station deactivated
2 = Station not exists
3 = Master lock
4 = Invalid slave response
5 = Parameter fault
6 = Not supported
7 = Config fault
8 = Station not ready
9 = Static diagnosis
10 = Diagnosis overflow
11 = Physical fault
12 = Data-Exchange left
13 = Severe bus fault
14 = Telegram fault
15 = Station has no resources
16 = Service not activated
17 = Unexpected telegram
18 = Station ready
31 = only for EtherCAT gateways: WC-State of cyclic EtherCAT frame is 1
128 = slave, waiting for data transfer (or DP-Master in CLEAR-Mode)
129 = slave, waiting for configuration
130 = slave, waiting for parameter
131 = slave, waiting for baudrate

ExtDiagFlag

The flag indicates whether slave diagnosis is active. It can be read via the System Manager or the PLC through ADS (see ADS interface).

Note 		Grayed out System Manager functions
In contrast to other PROFIBUS masters from Beckhoff, not all PROFIBUS features are supported. Therefore, some options are grayed out in the System Manager or are not displayed. See Technical data CX8030 PROFIBUS.


CX8093 - PROFIBUS Interface

BECKHOFF CX8031: Parameterization and commissioning

PROFIBUS Interface

PROFIBUS communication takes place via the D-sub port X101.

Note 		No ADS via PROFIBUS
The CX8031 does not support the ADS via PROFIBUS. The program download and debugging can take place exclusively via the Ethernet interface.

PROFIBUS address

The PROFIBUS address can be assigned using the DIP switch or permanently assigned in the System Manager. If the address is permanently defined, the address switch is ignored (see DIP switch).

GSD file

The GSD file is located in the TwinCAT folder \TwinCAT\IO\PROFIBUS. File name C8310CD7.gsd, the matching image is CX8031.dib. Insert these two files, image and GSD file, into your master configuration software.

PROFIBUS DpState

You can display the status of the PROFIBUS communication via the DpState and ascertain whether the slave is exchanging data (DpState=0) or whether there is an error or a problem.

0 = No error
1 = Station deactivated
2 = Station not exists
3 = Master lock
4 = Invalid slave response
5 = Parameter fault
6 = Not supported
7 = Config fault
8 = Station not ready
9 = Static diagnosis
10 = Diagnosis overflow
11 = Physical fault
12 = Data-Exchange left
13 = Severe bus fault
14 = Telegram fault
15 = Station has no ressources
16 = Service not activated
17 = Unexpected telegram
18 = Station ready
31 = only for EtherCAT gateways: WC-State of cyclic EtherCAT frame is 1
128 = slave, waiting for data transfer (or DP-Master in CLEAR-Mode)
129 = slave, waiting for configuration
130 = slave, waiting for parameter
131 = slave, waiting for baudrate

PROFIBUS ExtDiagFlag

Has no meaning in the case of the slave.


CX8031 - PROFIBUS process data

BECKHOFF CX8031: Parameterization and commissioning

PROFIBUS process data

The CX8031 can exchange up to 240 bytes of process data with the PROFIBUS master in the input and output direction via PROFIBUS. Various kinds of process data can be defined by means of the GSD file.

The data are transmitted by default in the Intel format. If your controller requires the data in the Motorola format they must be turned accordingly.

You can proceed in 3 possible ways here.

  • Turning the data on the PLC, i.e. on the CX side, with a simple ROR command (example for ST: VarProfibus:=ROR (VarAnalog,8); (* both variables are of the type WORD*))
  • Turning the data on the master side
  • Turning the data in the System Manager

To do this, go to the variable that you wish to turn, select Flags and tick the option that you need. In the case of WORD variables you can only swap the LO and HI byte, in the case of DWORDs you can additionally swap the WORD.

Example: for DWORD

(Intel format)
Data of the CX80xx | Data which the master receives
Original data | No checkbox selected | Swap Byte (blue) | Swap Word (green) | Swap both (blue and green)
0x01020304 | 0x01020304 | 0x02010403 | 0x03040102 | 0x04030201


CX8031 - Virtual slave interface for PROFIBUS

BECKHOFF CX8031: Parameterization and commissioning

Virtual slave interface for PROFIBUS

The virtual slave interface enables the creation of up to three virtual slaves on the same hardware interface. This enables the user to exchange more data with a PROFIBUS master or also to establish a connection with a second PROFIBUS master.

A maximum of 240 bytes of data can be configured for each slave, i.e. in total you can exchange 4 x 240 bytes of data in each direction.

Append a maximum of four CX8031 devices to your PROFIBUS device (fig. 1.0). Each of these devices is given a PROFIBUS address via the System Manager which can also be linked with the address selector (see Address switch). Append the process data under the box (figs. 1.1 and 1.2); these may not exceed 240 bytes of input data of 240 bytes of output data. For the PROFIBUS master configure each of the four slaves like an independent device.

It is also permitted to connect one or more slaves to a second PROFIBUS master. The master must support the multi-master capability. You do not need to make any further settings on the CX8031 for this.

Fig. 1.0 Creation of the 4 PROFIBUS slave devices

Fig. 1.1 Appending the PROFIBUS modules

Fig. 1.2 Selection of the PROFIBUS modules


CX80xx - Upnp web pages

BECKHOFF CX80xx: Web services

Upnp web pages

There is a Upnp webpage on the CX80xx for diagnosis.

User name: guest
Password: 1

Enter the IP address or the device name.

Example

http://cx-0f94ac/config

http://172.16.17.55/config

The diagnostic page has been revised from v354c Image.


CX80xx - Web visualization

BECKHOFF CX80xx: Web services

Web visualization

There is a web visualization on the CX80xx. This can be prepared and activated with the help of the PLC Control in TwinCAT.

Fig. 1: activation of the web visualization in the PLC Control

The call is made via the IP address or the device name in a web browser.
Further information can be taken from the documentation on the web visualization (see TwinCAT Supplements PLC HMI Web).

Example

http://cx-0f94ac/TcWebVisu/

http://172.16.17.44/TcWebVisu/

Ascertain before logging in (i.e. in the logged out condition) whether a ADS connection is established to the CX – “TwinCAT Running” in the bottom right-hand corner must be green. If that is not the case, please go onto Online /Selection again and call the CX once again.

The following path must be specified for downloading the web data for the web user interface:

\hard disk\twincat\boot\webvisu\

If that is not the case, the PLC Control will copy the data into the wrong folder and the webpage will be displayed incorrectly or not at all.

Fig. 2: path specification


CX80xx - Remote Display

BECKHOFF CX80xx: Web services

Remote Display

This page describes the steps for remotely controlling a CE device with CE operating system from a further PC by ‘Remote Display’.

Requirements

Software required on the PC:

  • Windows NT, Windows 2000, Windows XP or Windows 7
  • Microsoft Remote Display (CERHOST, available licence-free from Microsoft)

Establishing the connection

The “Remote Display” tool is started on the PC. The address of the CE device can now be entered under the menu option “File - > Connect”; this can be both the TCP-IP address or, if available, also the name of the CE device.

If the CE device is provided with password protection, then the password must also be entered accordingly. No password is set in the delivery condition.

After entering the target address, the user interface of the CE device is available for remote control on the PC.

CERHOST download:


CX80xx - Real Time Clock (RTC)

BECKHOFF CX80xx: Parameterization and commissioning

Real Time Clock (RTC)

The RTC is read out via the FB_LocalSystemTime function blocks and can be set with the NT_SetLocalTime block (see TcUtilities.lib).

The RTC is supplied by the battery and can thus continue to run in the power-off state.


CX80xx -1 Second UPS

BECKHOFF CX80xx: Parameterization and commissioning

1-second UPS (Uninterruptible Power Supply

Technical concept

The 1-second UPS is an UltraCap capacitor, which, in the event of a voltage outage, continues to supply power to the processor for approx. 4 to 5 seconds, so that persistent data can be saved. Data saving generally takes less than 4 to 5 seconds. However, due to ageing of the components used, one should assume that the UPS can provide power for a maximum of 1 second. You can assume that data saving continues to work smoothly, even after many years. If you save data yourself, we recommend that this should take place within 1 second. Should it take longer, we would advise against it.

The 1-second UPS supplies neither the K-bus nor the E-bus with power. Please note that the data of these devices may already be invalid when the 1-second UPS is activated. Also, the fieldbus system (or Ethernet) may not work or not work properly once the 1-second UPS was activated.

Saving of the persistent data only takes place in conjunction with the function block FB_S_UPS_CX80xx. This block must be called cyclically. We strongly recommend using the default values for the block.

Saving and loading persistent data

The persistent data are stored on the SD card as a wdp file. When the PLC starts up, the wdp file is loaded from the SD card, saved there as a wd~-file (backup), and then deleted. Another current wpd file is not written until the system is shut down or the 1-second UPS is activated. If no wdp file is present when the CX starts up, the persistent data are invalid and are deleted (default setting).
The reason is that the 1-second UPS was activated before the TwinCAT PLC was started during startup of the CX. In this case no persistent data were saved, since the system was unable to ensure sufficient buffer time for saving the data.

Loading a backup of the persistent data

To load the persistent data from the backup (wp~-file), it has to be enabled in the System Manager.

Or via the following registry entry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Beckhoff\TwinCAT\Plc]"ClearInvalidPersistentData"= 0

The default factory setting is "1".

Checking whether current persistent data (from wdp file) or saved persistent data from the backup (wd~-file) were loaded

In this example, the CX8090 indicates via the ERR LED whether the persistent data were loaded. The LED cannot be used for other CX8xxx models.

IF systeminfo.bootDataFlags.4 AND NOT systeminfo.bootDataFlags.5 THEN
F_CX8090_LED_ERR(eLED_GREEN_ON); (* persistent data is OK *)
ELSIF systeminfo.bootDataFlags.4 AND systeminfo.bootDataFlags.5 THEN
F_CX8090_LED_ERR(eLED_RED_ON); (* load backup persistent data *)
ELSE
F_CX8090_LED_ERR(eLED_RED_FLASHING_200ms); (* no persistent data *)
END_IF

Note 		Purpose of the 1-second UPS
The 1-second UPS should only be used for managing the persistent data.
Other applications are not supported and are not covered by our complaints procedure.

Retain data cannot be used for the 1-second UPS!


CX8090 - CPU load

BECKHOFF CX8090: Parameterization and commissioning

CPU load

By default the CPU load display is deactivated on all CX80xx devices (this is displayed with a constant 10 %). The CPU load display is deactivated, since this accounts for a considerable portion of the CPU load itself. The CPU load can be activated for brief diagnostic help; however, we recommend that you deactivate it again after the diagnosis.

HKEY_LOCAL_MACHINE/SOFTWARE/BECKHOFF/TWINCAT/RTime/EnableRTimeMeasurement 0 deactivated, 1 activated

A software reset of the CX80xx is necessary after making the setting.

Notice 		CPU load
The CPU load is calculated internally with 10 ms.
If one or more tasks exceeding 10 ms are used, the CPU load may fluctuate very strongly.


Library for CX80xx

Library download


CX80xx - FUNCTION_BLOCK FB_S_UPS_CX80xx

BECKHOFF CX80xx: Programming

FUNCTION_BLOCK FB_S_UPS_CX80xx

The FB_S_UPS function block can be used on the CX80xx with the seconds UPS in order to activate the seconds UPS from the PLC. This allows the persistent data to be saved and a quick shutdown to be performed in the event of a power failure. If possible the default values of the INPUTs of the FB_S_UPS should be retained.

Attention 		Loss of data
The seconds UPS can be used only for a few seconds in the event of a power failure in order, for example, to save persistent data. The data must be saved in the fast persistent mode “SPDM_2PASS”, even though this can lead to real-time violations. Sufficient router memory must be configured for the storage of the persistent data!

The second UPS does not have sufficient capacity for bridging power failures. Saving can take place only on Micro SD cards.

A QuickShutdown is performed automatically in the eSUPS_WrPersistData_Shutdown mode (standard setting) after the storage of the persistent data.

In the eSUPS_WrPersistData_NoShutdown mode only the persistent data are saved, no QuickShutdown is performed.

In the eSUPS_ImmediateShutdown mode a QuickShutdown is executed immediately without saving data.

In the eSUPS_CheckPowerStatus mode only a check is performed as to whether a power failure has occurred. If this is the case, the module only switches back to the PowerOK state after the expiry of tRecoverTime (10s).

Independent of the mode and thus independent of the saving or the shutting down of the controller, the UPS switches the main board off after the capacitors have discharged, even if the voltage has returned in the meantime.

Attention 		Caution when using files:
If other applications or the PLC keep other files open or write to them, this can lead to faulty files if the UPS switches off the controller.

FUNCTION_BLOCK FB_S_UPS_CX80xx

VAR_INPUT

VAR_INPUT
    sNetID          : T_AmsNetId := '';               (* '' = local netid *)
    iPLCPort        : UINT := AMSPORT_R0_PLC_RTS1;    (* PLC Runtime System for writing persistent data *)
    iUPSPort        : UINT := 16#4A8;                 (* Port for reading Power State of UPS, dafault 16#4A8 *)
    tTimeout        : TIME := DEFAULT_ADS_TIMEOUT;    (* ADS Timeout *)
    eUpsMode        : E_S_UPS_Mode := eSUPS_WrPersistData_Shutdown; (* UPS mode (w/wo writing persistent data, w/wo shutdown) *)
    ePersistentMode : E_PersistentMode := SPDM_2PASS; (* mode for writing persistent data *)
    tRecoverTime    : TIME := T#10s;                  (* ON time to recover from short power failure in mode eSUPS_WrPersistData_NoShutdown/eSUPS_CheckPowerStatus *)
END_VAR

sNetID : AmsNetID of the controller.

iPLCPort : Port number of the PLC runtime system (AMSPORT_R0_PLC_RTS1 = 801, AMSPORT_R0_PLC_RTS2 = 811, AMSPORT_R0_PLC_RTS3 = 821, AMSPORT_R0_PLC_RTS4 = 831).

iUPSPort : Port number via which the UPS status is read (standard value is 16#4A8).

tTimeout : Timeout for the execution of the QuickShutdown.

eUpsMode : The eUpsMode defines whether persistent data are to be written and whether a QuickShutdown is to be performed.
Standard value is eSUPS_WrPersistData_Shutdown, i.e. with writing of the persistent data and then QuickShutdown. See E_S_UPS_Mode.

ePersistentMode : Mode for the writing of the persistent data. Standard value is SPDM_2PASS.
SPDM_2PASS, all persistent data are saved at once, which can lead to the cycle time being exceeded.
SPDM_VAR_BOOST, here, each persistent variable is written separately; if there is a large amount of persistent data this can accordingly take many cycles. This is not recommended as some data may be lost if the time of the seconds UPS is not sufficient.

tRecoverTime : Time after which the UPS reverts to the PowerOK status in the case of UPS modes without shutdown.
The tRecoverTime must be somewhat longer than the maximum holding time of the UPS, since the UPS switches off even when the voltage returns.

VAR_OUTPUT

VAR_OUTPUT
    bPowerFailDetect	: BOOL;            (* TRUE while powerfailure is detected *)
    eState 		: E_S_UPS_State;   (* current ups state *)
END_VAR

bPowerFailDetect : True during the power failure; False if the supply voltage is present.

eState : Internal state of the function block, for values see E_S_UPS_State.

VAR_GLOBAL

VAR_GLOBAL
    eGlobalSUpsState : E_S_UPS_State;    (* current ups state *)
END_VAR

eGlobalUpsState : Internal state of the function block as a global copy of the VAR_OUTPUT eState; for values see E_S_UPS_State.

Development environment | Target platform | Hardware | PLC libraries to be linked
TwinCAT v2.11.0 build 2220 or higher (R3) | ARM | Seconds UPS | -


CX80xx - TYPE E_S_UPS_Mode

BECKHOFF CX80xx: Programming

TYPE E_S_UPS_Mode

eSUPS_WrPersistData_Shutdown:   write persistent data and then QuickShutdown
eSUPS_WrPersistData_NoShutdown: write persistent data only (no QuickShutdown)
eSUPS_ImmediateShutdown:        QuickShutdown only (no writing of persistent data)
eSUPS_CheckPowerStatus:         determine status only (neither write persistent data nor QuickShutdown)

Development environment | Target platform | Hardware | PLC libraries to be linked
TwinCAT v2.11.0 build 2220 or higher (R3) | ARM | Seconds UPS | -


CX80xx - TYPE E_S_UPS_State

BECKHOFF CX80xx: Programming

TYPE E_S_UPS_State

eSUPS_PowerOK:
    in all modes: supply voltage is OK

eSUPS_PowerFailure:
    in all modes: Supply voltage faulty (applied for one cycle only)

eSUPS_WritePersistentData:
    in eSUPS_WrPersistData_Shutdown mode: writing of the persistent data is active
    in eSUPS_WrPersistData_NoShutdown mode: writing of the persistent data is active

eSUPS_QuickShutdown:
    in eSUPS_WrPersistData_Shutdown mode: QuickShutdown is active
    in eSUPS_ImmediateShutdown mode: QuickShutdown is active

eSUPS_WaitForRecover:
    in eSUPS_WrPersistData_NoShutdown mode: wait for return of the voltage
    in eSUPS_CheckPowerStatus mode: wait for return of the voltage

eSUPS_WaitForPowerOFF:
    in eSUPS_WrPersistData_Shutdown mode: wait for shutdown by the UPS
    in eSUPS_ImmediateShutdown mode: wait for shutdown by the UPS

Development environment | Target platform | Hardware | PLC libraries to be linked
TwinCAT v2.11.0 build 2220 or higher (R3) | ARM | Seconds UPS | -


CX80xx - FUNCTION_CX80xx_ADDRESS

BECKHOFF CX80xx: Programming

FUNCTION F_CX80xx_ADDRESS

With this function the address selection switch or the DIP switch of the CX80xx device can be read out. Here, for example, you can activate different parts of the program depending on the address by reading the switch position.

VAR_INPUT

VAR_INPUT
    iCX_Typ          : INT;
END_VAR

iCX_Typ : The CX type used is entered here - just the number without the designation CX: for example, CX8031 is then entered as 8031.

VAR_OUTPUT

F_CX80xx_ADDRESS		: INT;

F_CX80xx_ADDRESS : -1, non-implemented CX, address of the switch

Development environment | Target platform | Hardware | PLC libraries to be linked
TwinCAT v2.11.0 build 2220 or higher (R3) | ARM | CX80xx | -


CX8030 - ADS Interface

BECKHOFF CX8030: ADS Interface

CX8030 ADS Interface

ADS NetId of the PROFIBUS interface

A NetId is required for the ADS communication. This can be found in the ADS tab of the PROFIBUS interface in the TwinCAT System Manager.

ADS Interface

All acyclic data are transmitted to or from the CX8030 via ADS-Read, ADS-Write or ADS-Write-Control. The CX8030 has its own Net-ID and supports the following ports:

Port | Description
200 | Addresses the PROFIBUS interface itself, i.e. data stored locally on the PROFIBUS interface, for which usually no additional bus access is required.
0x1000 - 0x107E | Addresses a connected PROFIBUS device, whereby the address is calculated from port 0x1000 (or 0x1000 + slave address); always includes bus access.

ADS-Read

An overview of the IndexGroups/IndexOffsets supported by the CX8030 during ADS-Read is provided below.

IndexGroup for local CX8030 addressing (port 200)

IndexGroup (Lo-Word) | IndexGroup (Hi-Word) | IndexOffset | Description
0xF181 | 0x0000-0x007E | BYTE offset within the data | This will read the diagnostic data of a configured DP slave. The station address is calculated from the IndexGroup(Hi-Word). If the ADS Read is answered without error (error code = 0), the data will contain the diagnostic data of a configured DP slave described in section Slave Diagnosis.
0xF830 | 0x0000-0x007E | always 0 | Can be used to determine which DP slaves are present on the PROFIBUS, regardless of whether they were configured or not; the station address is entered in the IndexGroup (high word). If the ADS-Read is answered without error (error code = 0), the corresponding DP slave has answered correctly. The data contain the Ident no. of the slave (BYTE offset 0-1) and the read CfgData (from BYTE offset 2) (see section Upload Configuration).

IndexGroup for addressing of a configured PROFIBUS device (port 0x1000-0x107E)

IndexGroup (Lo-Word) | IndexGroup (Hi-Word) | IndexOffset | Description
0x00-0xFF | 0x00 | 0x00-0xFF | This will send a DPV1-Read to the appropriate, configured DPV1 slave via a Class -1 connection; the DPV1 slot number corresponds to the IndexGroup, the DPV1 index corresponds to the IndexOffset. If the ADS-Read is answered without error (error code = 0), the data will contain the read DPV1 data (see section DPV1)

ADS Write

An overview of the IndexGroups/IndexOffsets supported by the CX8030 during ADS-Write is provided below.

IndexGroup for addressing of a configured PROFIBUS device (port 0x1000-0x107E)

IndexGroup (Lo-Word) | IndexGroup (Hi-Word) | IndexOffset | Description
0x00-0xFF | 0x00 | 0x00-0xFF | This will send a DPV1-Write to the appropriate, configured DPV1 slave via a Class -1 connection; the DPV1 slot number corresponds to the IndexGroup, the DPV1 index corresponds to the IndexOffset (see section DPV1).

ADS-WriteControl

An overview of services supported by the CX8030 for ADS WriteControl is provided below.

ADS-WriteControl for addressing a configured PROFIBUS device (port 0x1000-0x107E)

AdsState | DeviceState | State of the FC310x/EL6731 | Description
STOP (6) | 0x00 | RUN (5) | This will stop the slave, i.e. the process data connection to the relevant DP slave (Data_Exchange) is removed (with SetPrm,Unlock).
RUN (5) | 0x00 | STOP (6) | This will restart the slave after a stop, i.e. the process data connection to the relevant DP slave (Data_Exchange) is re-established (normal DP start-up).


CX8030 - DP-V1 communication

BECKHOFF CX8030: ADS Interface

DPV1 communication

On a C1 connection, the master supports the Read and Write services, and on the C2 connection it supports the Read, Write, Data_Transport, Initiate and Abort services.

C1 Connection (MSAC-C1)

The C1 connection is reserved for the master that cyclically exchanges data with the slave (C1 master). In order for a slave to be able to use the C1 connection, the slave must support DPV1 (this means that the line "DPV1_Slave = 1" and the key word "C1_Max_Data_Len" with an appropriate length must be in the GSD file). If it is also generally necessary to activate the C1 functionality by setting bit 7 in the PrmData byte 0 for the corresponding slave (this is done automatically for those Beckhoff devices that support DPV1).

MSAC-C1-Read is shown in ADS-Read, and MSAC-C1-Write is represented in ADS-Write:

MSAC-C1 Read

ADS-Read parameters | Meaning
Net-ID | Net-ID of the master (see the device's ADS tab)
Port | 0x1000 + station address of the slave
IndexGroup | Slot number (DPV1 parameter)
IndexOffset | Index (DPV1 parameter)
Length | Length of the data that is to be read
Data | In response: data that has been read

MSAC-C1 Write

ADS-Write parameters | Meaning
Net-ID | Net-ID of the master (see the device's ADS tab)
Port | 0x1000 + station address of the slave
IndexGroup | Slot number (DPV1 parameter)
IndexOffset | Index (DPV1 parameter)
Length | Length of the data that is to be written
Data | In request: data that is to be written


CX8030 - Slave diagnosis

BECKHOFF CX8030: SLAVE diagnosis

Slave diagnosis

DP-State

Each DP slave has a status variable that indicates the current state of that DP slave. This status is maintained in real time, so that it is always adapted to the current DP slave data, and can be linked to a PLC variable (-> DpState of the slave):

Diagnostic data

Any DP slave can acyclically report DP diagnostic data during data exchange operation. The slave here sets the Diag_Flag in the response to the cyclic Data_Exchange telegram, as a result of which the DP master automatically reads the DP diagnostic data from the slave. This does not affect the Data-Exchange cycle in the Beckhoff DP master, because the DP diagnostic telegram is sent at the end of the cyclic Data-Exchange cycle, and before the beginning of the next cycle. If the DP diagnostic data read from the slave has changed from its previous state, the DP master sets the ExtDiagFlag variable, which can be linked to a variable in the controller program.

The DP slave's current diagnostic data is displayed in the system manager on the slave's Diag tab. It can also be read by the controller program via ADS, which will cause the "ExtDiagFlag" flag to be reset once more:

ADS-Read parameters | Meaning
Net-ID | Net-ID of the master (see the device's ADS tab)
Port | 200
IndexGroup | 0x00yyF181 (yy = station address of the slave)
IndexOffset | offset within the diagnosis data
Length | Length of the diagnostic data that is to be read
Data | Diagnostic data

The diagnostic data contains the slave statistics (32 bytes) and the DP diagnostic data sent by the slave (up to 244 bytes), and is constructed as follows:

Offset | Meaning
Slave statistics
0 | Receive Error Counter (WORD): The number of faulty telegrams occurring while communicating with this slave.
2 | Repeat Counter[8] (WORD): The repeat counters indicate how many repeats have had to be made, and how often. Repeat Counter[0] indicates how often it has been necessary to repeat a telegram for this slave once, Repeat Counter[1] shows how often a telegram for this slave has had to be repeated twice, and so on. The maximum number of retries is set with the parameter Max Retry Limit (see bus parameters dialog). The value range is from 0 to 8, therefore there are 8 repeat counters (for 1 to 8 retries)
18 | reserved for extensions
20 | NoAnswer Counter (DWORD): The number of telegrams in communication with this slave that have not received an answer. The first time that a slave fails to answer, the telegram is repeated up to MaxRetryLimit times, but if it does not answer even then, further telegrams are not repeated.
24-27 | Last-DPV1-Error[4] (BYTE): The most recent faulty DPV1 response is entered here (byte 0: DPV1 service (bit 7 is set, thus indicating an error), byte 1: Error_Decode, byte 2: Error_Code_1 (Error_Class/Error_Code), byte 3: Error_Code_2), see description of the DPV1 error codes
27-31 | reserved for extensions
from 32 | DP diagnostic data

DP Diagnostic Data - DiagData

There follows a description of the DP diagnostic data

Offset | Meaning
0x00.0 | StationNonExistent: slave did not reply to the last telegram
0x00.1 | StationNotReady: slave still processing the Set_Prm / Chk_Cfg telegram
0x00.2 | CfgFault: slave signaling a configuration error
0x00.3 | ExtDiag: extended DiagData available and valid
0x00.4 | NotSupported: slave does not support a feature requested via Set_Prm or Global_Control
0x00.5 | InvalidSlaveResponse: slave response not DP-compatible
0x00.6 | PrmFault: slave reports a parameterization error
0x00.7 | MasterLock: slave currently exchanging data with another master
0x01.0 | PrmReq: re-parameterize and reconfigure slave
0x01.1 | StatDiag: slave signaling static diagnosis / DPV1 slave application not yet ready for data exchange
0x01.2 | PROFIBUS DP slave
0x01.3 | WdOn: DP watchdog on
0x01.4 | FreezeMode: DP slave in freeze mode
0x01.5 | SyncMode: DP slave in sync mode
0x01.6 | reserved
0x01.7 | Deactivated: DP slave has been deactivated
0x02.0 | reserved
0x02.1 | reserved
0x02.2 | reserved
0x02.3 | reserved
0x02.4 | reserved
0x02.5 | reserved
0x02.6 | reserved
0x02.7 | ExtDiagOverflow: too much extended data present
0x03 | MasterAdd: station address of master with which slave is exchanging data
0x04, 0x05 | IdentNumber
from 0x06 | Extended DiagData

Extended DiagData

A distinction is made in the Extended DiagData between identification diagnosis, channel diagnosis and manufacturer-specific diagnosis. The first byte indicates the type of the diagnosis and the length of the associated data. Several diagnostic types can also follow one another in the Extended DiagData.

Header Byte

Bit | Meaning
0-5 | Length of the associated diagnostic data, including header byte
6-7 | 0 = manufacturer-specific diagnosis (DPV1 is not supported) or DPV1 diagnosis (DPV1 is supported (DPV1_Enable = 1) in associated GSD file)
 | Module diagnosis
 | Channel diagnosis
 | Revision number

Manufacturer-specific diagnosis

The structure of the manufacturer-specific diagnosis may be found in the documentation for the DP slave.


CX803x - Uploading the Configuration

BECKHOFF CX8030: Upload configuration

Uploading the Configuration

During operation the PROFIBUS can be scanned for new devices via ADS Read:

ADS-Read parameters | Meaning
Net-ID | Net-ID of the master (see the device's ADS tab)
Port | 200
IndexGroup | 0x00yyF830 (yy = station address, Beckhoff devices provide the same information as other devices)
IndexOffset | 0
Length | 1538
Data | Configuration data of the slave

If the device is from another manufacturer, or if the IndexGroup indicates that Beckhoff devices are to behave in exactly the same way as devices from other manufacturers, then the following information is returned in the ADS read response:

Offset | Description
0 -1 | 1
2 - 7 | DP diagnostic data bytes 0-5 (see Slave Diagnosis)
8 - 251 | DP configuration data (CfgData)


CX8031 - PROFIBUS diagnostic data

BECKHOFF CX8031: Error handling and diagnosis

PROFIBUS diagnostic data

The decentralized CX8031 controller enables you to send diagnostic data from the PLC. You may write your own diagnostic message for the master and fill it individually with data (see device-specific diagnostic data).

DP Diagnostic Data (DiagData)

The DP diagnostic data consists of six bytes of DP standard diagnosis, along with up to 238 bytes of device-specific diagnostic data.

When the DP diagnostic data changes, the slave reports this fact to the master, and the master will automatically fetch the changed diagnostic data. This means that DP diagnostic data is not included in the DP process data in real-time, but is always sent to the controller a few cycles later.

In TwinCAT the DP diagnostic data is read from the DP Master interface (FC310x, CX1500-M310) using ADS (see the section describing Slave Diagnosis in the FC310x documentation).

DP standard diagnostic data

Offset | Meaning
0x00.0 | StationNonExistent: slave did not reply to the last telegram
0x00.1 | StationNotReady: slave still processing the Set_Prm / Chk_Cfg telegram
0x00.2 | CfgFault: slave signalling a configuration error
0x00.3 | ExtDiag: extended DiagData available and valid
0x00.4 | NotSupported: slave does not support a feature requested via Set_Prm or Global_Control
0x00.5 | InvalidSlaveResponse: slave response not DP-compatible
0x00.6 | PrmFault: slave reports a parameterization error
0x00.7 | MasterLock: slave currently exchanging data with another master
0x01.0 | PrmReq: re-parameterise and reconfigure slave
0x01.1 | StatDiag: slave signalling static diagnosis / DPV1 slave application not yet ready for data exchange
0x01.2 | PROFIBUS DP slave
0x01.3 | WdOn: DP watchdog on
0x01.4 | FreezeMode: DP slave in freeze mode
0x01.5 | SyncMode: DP slave in sync mode
0x01.6 | reserved
0x01.7 | Deactivated: DP slave has been deactivated
0x02.0 | reserved
0x02.1 | reserved
0x02.2 | reserved
0x02.3 | reserved
0x02.4 | reserved
0x02.5 | reserved
0x02.6 | reserved
0x02.7 | ExtDiagOverflow: too much extended data present
0x03 | MasterAdd: station address of master with which slave is exchanging data
0x04, 0x05 | IdentNumber
from 0x06 | Device-specific diagnostic data (extended DiagData)

Device-specific diagnostic data

The ADSWRITE block is used for sending diagnostic data. The current DP diagnosis sent to the bus can be read via ADSREAD. Please note that an additional 6 bytes (PROFIBUS standard DP diagnosis) are required for reading, i.e. the number of bytes that are read exceeds the number of bytes that were written by 6. The ADS parameters for the read process are identical.

Input parameters | Description
NETID | local NetId of the PROFIBUS device
PORT number | 0x1000+slave address
IDXGRP | 16#F481
IDXOFFS | 0
LEN | max. 244
SRCADDR | Pointer to diagnostic data

Note 		Transmission of the diagnostic telegram
A diagnostic telegram is only transferred to the controller when the diagnostic data have changed.

Note 		Transmission of user-specific diagnostic data
Byte 0 of the data must contain a 0x08. Bytes 1 to 5 are overwritten by the CX. Byte 6 and higher can contain your own diagnostic data.
Make sure that your own diagnostic data conforms to the PROFIBUS standard for user-specific diagnosis.


CX8031 - PROFIBUS DP-V1 communication

BECKHOFF CX8031: Error handling and diagnosis

PROFIBUS DP-V1 communication

C1 Connection (MSAC-C1)

The C1 connection is reserved for the master that cyclically exchanges data with the slave (C1 master). In order for a slave to be able to use the C1 connection, the slave must support DPV1 (this means that the line "DPV1_Slave = 1" and the key word "C1_Max_Data_Len" with an appropriate length must be in the GSD file). If it is also generally necessary to activate the C1 functionality by setting bit 7 in the PrmData byte 0 (see the slave's PROFIBUS tab) for the corresponding slave (this is done automatically for those Beckhoff devices that support DPV1).

MSAC-C1-Read is mapped on ADS-Readind, MSAC-C1-Write on ADS-Writeinc:

PROFIBUS DPV1

The DP slave supports a DPV1-MSAC_C1 server connection that is established along with the cyclic connection. This can be used so that larger quantities of acyclic data can be transferred alongside the cyclic data. A DPV1 read telegram received by the master is reported to the PLC as an ADS read indication, while a DPV1 write telegram is reported to the PLC as an ADS write indication. The PLC program is then responsible for the read or write response. To do this, the ADS read response or ADS write response functions are to be called.

Settings in the System Manager

In order to transport the DP-V1 services into the PLC this function must be activated by specifying the port.

Port 0 deactivated, 802 PLC runtime system 1, task 1

MSAC-C1 Read

A DPV1-MSAC_C1 read indication is represented in an ADS read indication as follows:

ADS read indication parameter | Meaning
Source-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab)
Source-Port (PORT) | 0x1000+slave address
Invoke-ID (INVOKEID) | A unique number that must reappear in the response
IndexGroup (IDXGRP) | Slot number (DPV1 parameter)
IndexOffset (IDXOFFS) | Index (DPV1 parameter)
Length (LENGTH) | Length of the data that is to be read

An ADS read response is represented in a DPV1-MSAC_C1 read response as follows:

ADS read response parameter | Meaning
Destination-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab)
Destination-Port (PORT) | 0x1000+slave address
Invoke-ID (INVOKEID) | A unique number, as under indication
Result (RESULT) | Result of the read: 0 = no error, otherwise: bits 0-15 = standard ADS error codes, bits 16-23 = Error_Code_1, bits 24-31 = Error_Code_2, see description of the DPV1 error codes
Length (LENGTH) | Length of the data that has been read
Data (DATAADDR) | read data

MSAC-C1 Write

A DPV1-MSAC_C1 write indication is represented in an ADS write indication as follows:

ADS write indication parameter | Meaning
Source-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab)
Source-Port (PORT) | 0x1000+slave address
Invoke-ID (INVOKEID) | A unique number that must reappear in the response
IndexGroup (IDXGRP) | Slot number (DPV1 parameter)
IndexOffset (IDXOFFS) | Index (DPV1 parameter)
Length (LENGTH) | Length of the data that is to be written
Data (DATAADDR) | data that is to be written

An ADS read response is represented in a DPV1-MSAC_C1 read response as follows:

ADS read response parameter | Meaning
Destination-Net-ID (NETID) | Net-ID of the slave (see the device's ADS tab)
Destination-Port (PORT) | 0x1000+slave address
Invoke-ID (INVOKEID) | A unique number, as under indication
Result (RESULT) | Result of the read: 0 = no error, otherwise: bits 0-15 = standard ADS error code, bits 16-23 = Error_Code_1, bits 24-31 = Error_Code_2, see description of the DPV1 error codes
Length (LENGTH) | Length of the data that has been read


BECKHOFF PROFIBUS - DPV1 Error Codes

BECKHOFF PROFIBUS: Diagnosis and Error Description

DPV1 Error Codes

In the event of an incorrect DPV1 access, the slave replies with 4 bytes of data (any values that are not described here are not defined in the DPV1 standard, and are therefore to be found in the slave's manual).

Byte 0 | DPV1 service
0xD1 | Data_Transport
0xD7 | Initiate
0xDE | Read
0xDF | Write
Byte 1 | Error_Decode
0x80 | DPV1
0xFE | FMS
0xFF | HART
Byte 2 |  | Error_Code_1
Error-Class (bits 4-7) | Error-Code (bits 0-3) |
0x0A | 0x00 | Application, Read Error
 | 0x01 | Application, Write Error
 | 0x02 | Application, Module Failure
 | 0x08 | Application, Version Conflict
 | 0x09 | Application, Feature Not Supported
0x0B | 0x00 | Access, Invalid Index
 | 0x01 | Access, Write Length Error
 | 0x02 | Access, Invalid Slot
 | 0x03 | Access, Type Conflict
 | 0x04 | Access, Invalid Area
 | 0x05 | Access, State Conflict
 | 0x06 | Access, Access Denied
 | 0x07 | Access, Invalid Range
 | 0x08 | Access, Invalid Parameter
 | 0x09 | Access, Invalid Type
0x0C | 0x00 | Resource, Read Constrain Conflict
 | 0x01 | Resource, Write Constrain Conflict
 | 0x02 | Resource, Busy
 | 0x03 | Resource, Unavailable


Ethernet

Ethernet was originally developed by DEC, Intel and XEROX (as the DIX standard) for passing data between office devices. The term nowadays generally refers to the IEEE 802.3 CSMA/CD specification, published in 1985. Because of the high acceptance around the world this technology is available everywhere and is very economical. This means that it is easy to make connections to existing networks.

There are now a number of quite different transmission media: coaxial cable (10Base5), optical fiber (10BaseF) or twisted pairs (10BaseT) with screen (STP) or without screen (UTP). A variety of topologies such as ring, line or star can be constructed with Ethernet.

Ethernet transmits Ethernet packets from a sender to one or more receivers. This transmission takes place without acknowledgement, and without the repetition of lost packets. To achieve reliable data communication, there are protocols, such as TCP/IP, that can run on top of Ethernet.

MAC-ID

The sender and receiver of Ethernet packets are addressed by means of the MAC-ID. The MAC-ID is a 6 byte identification code unique to every Ethernet device in the world. The MAC-ID consists of two parts. The first part (i.e. the first 3 bytes) is a manufacturer identifier. The identifier for Beckhoff is 00 01 05. The next 3 bytes are assigned by the manufacturer and implement a unique serial number. The MAC-ID can, for example, be used for the BootP protocol in order to set the TCP/IP number. This involves sending a telegram containing the information such as the name or the TCP/IP number to the corresponding node. You can read the MAC-ID with the KS2000 configuration software.

The Internet Protocol (IP)

The internet protocol (IP) forms the basis of this data communication. IP transports data packets from one device to another; the devices can be in the same network, or in different networks. IP here looks after the address management (finding and assigning MAC-IDs), segmentation and routing. Like the Ethernet protocol, IP does not guarantee that the data is transported - data packets can be lost, or their sequence can be changed.

TCP/IP was developed to provide standardized, reliable data exchange between any number of different networks. TCP/IP is thus substantially independent of the hardware or software being used. Although the term is often used as if it were a single concept, a number of protocols are layered together: e.g. IP, TCP, UDP, ARP and ICMP.

Transmission Control Protocol (TCP)

The Transmission Control Protocol (TCP) which runs on top of IP is a connection-oriented transport protocol. It includes error detection and error handling mechanisms. Lost telegrams are repeated.

User Datagram Protocol (UDP)

UDP is connectionless transport protocol. It provides no control mechanism when exchanging data between sender and receiver. This results in a higher processing speed than, for example, TCP. Checking whether or not the telegram has arrived must be carried out by the higher-level protocol.

Protocols running on top of TCP/IP and UDP/IP

The following protocols can run on top of TCP/IP or UDP:

  • ADS
  • ModbusTCP

Both of these protocols are implemented in parallel on the Bus Coupler, so that no configuration is needed to activate the protocols.

ADS can be used on top of either TCP or UDP, but ModbusTCP is always based on TCP/IP.


CX8031 - Topology example

BECKHOFF CX8031: Ethernet

Topology example

Note 		Observe system load
Observe the system load of your CX8031 when using further Ethernet protocols such as ModbusTCP/UDP or WebServices. A high load can slow down Ethernet communication significantly.


ADS Communication

The ADS protocol (ADS: Automation Device Specification) is a transport layer within the Beckhoff TwinCAT system. It was developed for data exchange between the different software modules, for instance the communication between the NC and the PLC. This protocol offers the freedom of using other tools to communicate with any point in TwinCAT. If it is necessary to communicate with another PC or device, the ADS protocol is used on top of TCP/IP. This means that in a networked system, all the data is accessible from any desired point.

The ADS protocol runs on top of the TCP/IP or UDP/IP protocols. It allows the user within the Beckhoff system to use almost any connecting route to communicate with all the connected devices and to parameterize them. Outside the Beckhoff system a variety of methods are available to exchange data with other software tools.

Software interfaces

ADS-OCX

The ADS-OCX is an Active-X component. It offers a standard interface to, for instance, Visual Basic, Delphi, etc.

ADS-DLL

You can link the ADS-DLL (DLL: Dynamic Link Library) into your C program.

OPC

The OPC interface is a standardised interface for communication used in automation engineering. Beckhoff offer an OPC server for this purpose.


ADS protocol

The ADS functions provide a method for accessing the Bus Coupler information directly from the PC. ADS function blocks can be used in TwinCAT PLC Control for this. The function blocks are contained in the PLCSystem.lib library. It is also equally possible to call the ADS functions from AdsOCX, ADSDLL or OPC.

AMSNetID

The AMSNetID provides a reference to the device that is to be addressed. This is taken from the Mac address of the first Ethernet port (X001) and is printed on the side of the CX80xx. For the AMSNetID the bytes 3 to 6 plus “.1.1” are typically used.
Example:
MAC address 00-01-05-01-02-03
AMSNetID 5.1.2.3.1.1

Port number

The port number distinguishes sub-elements in the connected device.
Port 801: local process data PLC runtime 1

Index group

The index group distinguishes different data within a port.

Index offset

Indicates the offset, the byte from which reading or writing is to start.

Len

Gives the length of the data, in bytes, that is to be read or written.

TCP port number

The TCP port number for the ADS protocol is 48898 or 0xBF02.


System overview PROFIBUS

As a fast, open bus system with line topology and terminators, PROFIBUS is widely used in automation technology. The PROFIBUS DP (Decentralized Periphery) variant for the fast exchange of data at sensor/actuator level is internationally standardized according to IEC 61158, IEC 61784 and EN 50170.

In PROFIBUS DP, central control devices (e.g. Industrial PCs or PLCs) communicate via a fast serial connection with decentralized input and output modules. RS485 is the most frequently used transmission technique, using a screened twisted pair cable. Data is mainly exchanged cyclically, although acyclic services (DP-V1) are available for parameterization and diagnosis.

PROFIBUS DP offers very short system reaction times: at a transmission rate of 12 MB, less than 2 ms are required to transmit 512 bits each of input and output data to 32 devices.

All Beckhoff PROFIBUS devices feature a high-performance protocol implementation and are certified by the PROFIBUS users organization (PNO).

PROFIBUS devices

Embedded PCs | CX8031 | Embedded PC with fieldbus interface PROFIBUS slave
 | CX50xx-M310 | Embedded PC with optional interface PROFIBUS master
 | CX50xx-B310 | Embedded PC with optional interface PROFIBUS slave
 | CX1500-M310 | PROFIBUS master interface for Embedded-PCs CX1010, CX1020 and CX1030
 | CX1500-B310 | PROFIBUS slave interface for Embedded-PCs CX1010, CX1020 and CX1030
EtherCAT Terminals | EL6731 | PROFIBUS master
 | EL6731-0010 | PROFIBUS slave
Bus Coupler | EK3100 | PROFIBUS Bus Coupler for EtherCAT Terminals
 | BK3010 | PROFIBUS Bus Coupler for Bus Terminals
 | BK3100 | PROFIBUS DP/FMS Bus Coupler for Bus Terminals
 | BK3110 | PROFIBUS „Economy“ Bus Coupler for Bus Terminals
 | BK3120 | PROFIBUS „Economy plus“-Bus Coupler for Bus Terminals
 | BK3150 | PROFIBUS „Compact“ Bus Coupler for Bus Terminals
 | BK3500 | PROFIBUS Bus Coupler with fiber-optic connector for Bus Terminals
 | BK3520 | PROFIBUS „Economy plus“ Bus Coupler with fiber-optic connector for Bus Terminals
 | LC3100 | PROFIBUS „Low Cost“ Bus Coupler for Bus Terminals
Bus Terminal Controller | BC3100 | PROFIBUS Bus Terminal Controller
 | BC3150 | PROFIBUS „Compact“ Bus Terminal Controller
 | BX3100 | PROFIBUS Bus Terminal Controller
Fieldbus Box | IPxxxx-B31x | PROFIBUS Compact Box
 | IL230x-B31x | PROFIBUS Coupler Box
 | IL230x-C31x | PROFIBUS PLC Box
Fieldbus Modules | FM33xx-B310 | Fieldbus modules with PROFIBUS interface
PC Fieldbus Cards | FC310x | PROFIBUS PCI card
 | FC312x | PROFIBUS PCI express card
 | FC3151 | PROFIBUS mini PCI card
Drive Technology | AX2xxx-B310 | Servo drive with PROFIBUS slave


Fieldbus Overview

PROFIBUS is a manufacturer - independent, open fieldbus standard with a wide range of applications in manufacturing and process automation. Manufacturer-independence and openness are guaranteed by the International standards EN 50170 and EN 50254. PROFIBUS allows devices from different manufacturers to communicate without the need for specially adapted interfaces. PROFIBUS is suitable both for fast, time-critical applications and for complex communication tasks.

PROFIBUS offers communication protocols of different functional levels: DP and FMS. According to the application, RS-485, IEC 1158-2 or optical fiber are available as transmission techniques.

PROFIBUS specifies the technical features of a serial fieldbus system with which distributed digital automation devices can be networked together, from the field level up to the cell level. PROFIBUS is a multi-master system, and therefore permits common operation of a number of automation, engineering or visualization systems with their distributed peripheral devices on one bus.

PROFIBUS distinguishes the following device types:

Master devices determine the data traffic on the bus. A master may transmit messages without having received an external request when it is in possession of the bus access authorization (token). Masters are also referred to as active devices.

Slave devices are peripheral devices such as input/output devices, valves, drives, measuring transducers and the Beckhoff PROFIBUS slaves from the BK3xx0, BC3xx0, IPxxxx-B310, IL230x-B310 and IL230x-C310 series. They do not receive any bus access authorization, so that they are only allowed to acknowledge messages that have been received, or to send messages in response to a request from master. Slaves are referred to as passive devices. They only require a small proportion of the bus protocol, which means that they can be implemented with little effort.

PROFIBUS DP

PROFIBUS DP is designed for efficient data exchange at the field level. The central automation devices such as PLC/PCs or process control systems communicate here over a fast serial link with distributed field devices such as I/O, drives, valves etc.. Data is primarily exchanged with these distributed devices cyclically. The communication functions required for this are specified by the basic DP functions in accordance with EN 50170.

In addition to these basic functions, PROFIBUS DP also offers extended acyclic communication services for such purposes as parameterization and other operations. These are also supported by the Beckhoff PROFIBUS slaves of the IPxxxx-B310, IL230x-B310 and IL230x-C310 series. A central controller (master) cyclically reads the input information from the slaves, and writes the output information cyclically to the slaves. The bus cycle time here should be shorter than the central automation system's program cycle time, which lies around 10 ms in many applications.

A high data throughput is not in itself sufficient for successful use of a bus system. Ease of handling, good diagnostic facilities and secure transmission technology are also of the utmost importance if the user’s demands are to be satisfied. These properties are ideally combined in PROFIBUS DP.

System configuration and device types

PROFIBUS DP allows single master or multi-master systems to be implemented. This permits a high level of flexibility in system configuration. A maximum of 126 devices (master or slaves) can be connected to one bus. A station address between 0 and 99 can be chosen for the Beckhoff PROFIBUS slaves from the IPxxxx-B310, IL230x- B310 and IL230x-C310 series. The specifications for the system configuration contain the number of stations, the assignment of the station addresses to the I/O addresses, data consistency of the I/O data and the format of the diagnostics messages and the bus parameters being used. Every PROFIBUS DP system consists of different device types. Three types of device are distinguished:

Type | Description
DP master class 1 (DPM1) e.g. Beckhoff PC master card FC310x | This involves a central controller that exchanges information cyclically with the distributed stations (slaves) in a specified message cycle. Typical devices include, for instance, programmable logic controllers (PLCs) or PCs.
DP master class 2 (DPM2) | Devices of this type are engineering, project design or operating devices. They are used for commissioning, for servicing and diagnosis in order to configure the connected devices, to evaluate measured values and parameters and to interrogate the status of devices.
DP slave e.g. Beckhoff Bus Coupler IPxxxx-B310 | A PROFIBUS DP slave is a peripheral device (I/O, drive, measuring transducer etc.) that reads input information and passes output information on to the peripherals. It is also possible to have devices that only handle either input or output information. The quantity of input and output information is device-dependent, and may not exceed 246 bytes of input data and 246 bytes of output data.

In single master systems only one master is active on the bus in the operating phase of the bus system. The PLC controller is the central control element. The distributed slaves are coupled to the PLC controller via the transmission medium. The shortest bus cycle time is achieved with this system configuration.

In a multi-master mode there is more than one master on the bus. They either form sub-systems that are independent of one another, each consisting of one DPM1 and the associated slaves, or additional project design and diagnostic devices. All the DP masters can read the input and output images of the slaves. Writing the outputs is only possible for one DP master (the one assigned as DPM1 during the project design). Multi-master systems achieve a medium bus cycle time. In time-critical applications, the increase in bus cycle time should be observed by adding a diagnostic tool.

Basic device files (GSD)

In PROFIBUS DP, the performance characteristics of devices are documented by the manufacturers and made available to users in the form of a device data sheet and of a basic device file. The structure, content and coding of these basic device files (GSD) is standardized. They make it easy to plan a project with any PROFIBUS DP slaves using project planning devices from a various manufacturers. The PROFIBUS User Organization (PROFIBUS Nutzer Organization - PNO) archives this information for all manufacturers, and will provide information about the GSD from any manufacturer on request. The GSD files are read by a PROFIBUS master configuration software, and appropriate adjustments are transferred to the PROFIBUS master. Please see the appropriate software manual from the master manufacturer for a description.

The Beckhoff GSD files may be obtained from the internet under www.beckhoff.com.

Diagnostic functions

The extensive diagnostic functions of PROFIBUS DP allow rapid fault localization. Diagnosis of the Beckhoff Bus Coupler is not activated in the default setting of the type file or the GSD file. The diagnostic messages are transmitted over the bus and collated by the master.

They are divided into three levels:

Diagnosis type | Description
Related to the station | Messages relating to the general readiness of a device for operation such as over-temperature or under-voltage
Related to the module | These messages indicate that diagnostic signals are pending within a specific I/O sub range of the device (e.g. an 8 bit output module)
Related to the channel | Here the cause of an error is related to a single input/output bit (channel), such as a short circuit on output 2

The Beckhoff PROFIBUS slaves from the IPxxxx-B310, IL230x-B310 and IL230x-C310 series support the PROFIBUS DP diagnostic functions. Assessment of the diagnostic data by means of the controller depends on the support for the PROFIBUS master. Please refer to the device manuals for the master interfaces for details of how to handle the diagnosis.

Sync and Freeze Mode

In addition to the user data traffic related to the device, which is automatically dealt with by DPM1, a DP master has the option of sending control commands to one DP slave, to a group of them or to all of them at the same time. These control commands are transmitted as multicasts. These control commands can be used to specify the sync and freeze operating modes, in order to synchronize the DP slave. They permit event-controlled synchronization of the DP slaves.

The DP slaves start sync mode when they receive a sync control command from the assigned DP master. In this operating mode, the outputs of all the addressed DP slaves are frozen at their current values. In the following user data transmissions, the DP slaves store the output data, but the output states themselves nevertheless remain unchanged. Only when the next sync control command is received from the master the stored output data is switched through to the outputs. Sync operation is ended with an unsync control command.

A freeze control command similarly causes the addressed DP slaves to enter freeze mode. In this operating mode the states of the inputs are frozen at their current value. The input data is only updated again when the DP master has sent the next freeze control command to the devices concerned. Freeze operation is ended with an unfreeze command.

System behavior

The system behavior is also standardized in PROFIBUS DP, so that devices can to a large extent be interchanged. It is largely determined by the operating condition of the DPM1. This can either be controlled locally, or over the bus by the project design device.

The following three principal conditions are distinguished:

Operation mode | Description
Stop | There is no data traffic between the DPM1 and the DP slaves. The Bus Coupler only addresses the Bus Terminals once after the power has been switched on (none of the I/O LEDs are lit).
Clear | The DPM1 reads the input information from the DP slaves, and maintains the outputs of the DP slaves in a safe state (depending on the reaction to fieldbus errors, the green I/O LED is lit and the outputs are set).
Operate | The DPM1 is in a data transfer phase. In the course of cyclic data traffic the inputs of the DP slaves are read and the output information is transmitted to the DP slaves (the green I/O LED is lit).

The DPM1 sends its local status at a configurable time interval using a multicast command cyclically to all the DP slaves that have been assigned to it. The reaction that the system has to the occurrence of an error during the DPM1's data transfer phase, such as the failure of a DP slave, is specified in the Auto-Clear operating parameter. If this parameter is set to True, then the DPM1 switches the outputs of all the associated DP slaves into a safe state as soon as one DP slave is no longer ready for the transfer of user data. The DPM1 then switches into the Clear state. If the parameter is False then the DPM1 remains in the operating state even after a fault, and the user can himself specify the system's reaction.

Data traffic between the DPM1 and the DP slaves

The data traffic between the DPM1 and the DP slaves that have been assigned to it is automatically executed by the DPM1 in a specified, continuously repeated sequence. The user specifies the assignment of a DP slave to the DPM1 when the bus system's project is being planned. Those DP slaves that are included in or excluded from the cyclic user data traffic are also defined.

The data traffic between the DPM1 and the DP slaves is divided into the parameterization, configuration and data transfer phases.

Before a DP slave is included in the data transfer phase, the DPM1 checks, in the parameterization and configuration phase, whether the theoretical configuration that has been planned agrees with the actual configuration of devices. The check requires the device type, the format and length information, as well as the number of inputs and outputs, to be in agreement. The user is thus provided with reliable protection against errors in parameterization. In addition to the transfer of user data, which is automatically carried out by the DPM1, it is possible to send new parameterization data to the DP slaves at the user's request.

Protection mechanisms

In the context of distributed peripherals it is necessary, for reasons of safety and reliability, for the system to be given extremely effective functions to protect against incorrect parameterization or the failure of the transmission mechanisms. PROFIBUS DP uses monitoring mechanisms in the DP Master and in the DP Slaves. They are implemented in the form of time monitors. The monitoring interval is specified in when the DP system project is planned.

Protection mechanisms | Description
At the DP Master | The DPM1 monitors the slave's transfer of user data with the Data_Control_Timer. An individual monitoring timer is used for each assigned slave. The time monitor triggers if a proper transfer of user data does not take place within the monitoring interval. In this case the user is informed. If automatic error reaction is enabled (Auto_Clear = True) then the DPM1 leaves the Operate state, switches the outputs of the assigned slaves into a safe state, and then goes into the Clear operating mode.
At the DP Slave | The slave uses communication monitoring in order to detect errors of the master or in the transmission segment. If data is not transferred with the assigned master within the communication monitoring interval the slave switches the outputs into the safe state itself. The slave inputs and outputs further require access protection in multi-master systems, to ensure that direct access is only made from the authorized master. The slaves will make an image of the inputs and outputs available to other masters, and this can be read by any other master even if it does not have access authorization.

Ident number

Every DP slave and every DPM1 must have an individual identification number. This is required so that a DP master can identify the types of the connected devices without any significant protocol overhead. The master compares the identification numbers of the connected DP devices with the identification numbers in the project planning data specified by DPM2. The transfer of user data only starts if the correct device types are connected to the bus at the correct station addresses. This provides protection from project planning errors. Manufacturer-specific identification numbers are issued by the PROFIBUS User Organization (PNO). The PNO administers the identification numbers along with the basic device data (GSD).


PROFIBUS DP

In PROFIBUS DP systems, a master (PLC, PC etc.) usually communicates with a large number of slaves (I/Os, drives etc.). Only the master may here actively access the bus (send telegrams on its own initiative), while a DP slave only sends telegrams when it is requested to do so by a master.

DP StartUp

Before the master and slave can cyclically exchange data, the parameter and configuration data is transmitted from the master to the slaves during the DP StartUp phase. After the parameter and configuration data has been sent, the master interrogates the slave's diagnostic data until the slave indicates that it is ready for data exchange. Depending on the extent of the calculations that the slave must carry out after receiving the parameter and configuration data, it can take up to a few seconds before it is ready for data exchange. For this reason the slave possesses the following states:

Parameter data

The parameter data is sent from the master to the slave in the SetPrmLock request telegram. The SetPrmLock response telegram does not contain any data, and therefore consists of a single byte, the short acknowledgement. The parameter data consists of DP parameters (e.g. the setting of the DP watchdog or checking the IdentNumber (unique to each DP device)), of DPV1-/DPV2 parameters and of application-specific parameters that only have to be transmitted once during the StartUp. If an error is found in the parameter data, this is indicated in the diagnostic data, and the slave either remains in or enters the WAIT-PRM state.

Configuration data

The configuration data is sent from the master to the slave in the ChkCfg request telegram. The ChkCfg response telegram does not contain any data, and therefore consists of a single byte, the short acknowledgement. The configuration data describes the assignment of the DP modules to the cyclic I/O data that is to be exchanged between the master and slave via the Data_Exchange telegram in the cyclic data exchange phase. The sequence of the DP modules added to a slave in the DP configuration tool determines the sequence of the associated I/O data in the Data_Exchange telegram.

Diagnostic data

The diagnostic data is requested by the master using a SlaveDiag request telegram without any data. The slave replies with the diagnostic data in a SlaveDiag response telegram. The diagnostic data consists of the standard DP diagnostics (e.g. the state of the slave, the IdentNumber) and of application-specific diagnostic data.

Cyclic data exchange

The heart of the PROFIBUS DP protocol is cyclic data exchange, during which the master carries out an exchange of I/O data with every slave during a PROFIBUS DP cycle. This involves the master sending the outputs to each slave with a DataExchange request telegram, while the slave replies with the inputs in a DataExchange response telegram. This means that all the output and/or input data is transmitted in one telegram, in which the DP configuration (the sequence of DP modules) specifies the assignment of the output and/or input data to the slave's actual process data.

Diagnosis during cyclic data exchange

A slave can send a diagnostics signal to the master during cyclic data exchange. In this case, the slave sets a flag in the DataExchange response telegram, whereby the master recognises that there is new diagnostic data in the slave. It then fetches that data in the SlaveDiag telegram. This means that diagnostic data is not transmitted to the controller with the cyclic I/O data in real-time, but is always at least one DP cycle later.

Synchronisation with Sync and Freeze

The Sync and Freeze commands in the GlobalControl request telegram (broadcast telegram) allow the master to synchronise the activation of the outputs (Sync) or the reading of the inputs (Freeze) in a number of slaves. When the Sync command is used, the slaves are first switched into Sync mode (a process that is acknowledged in the diagnostic data). The I/O data is then exchanged sequentially with the slaves in the DataExchange telegram. Transmitting the Sync command in the GlobalControl telegram then has the effect of causing the slaves to generate the most recently received outputs. In Freeze operation a Freeze command is first sent in the GlobalControl telegram, in response to which all the slaves latch their inputs. These are then fetched sequentially by the master in the DataExchange telegram.

States in the master

The master distinguishes between the CLEAR state (all outputs are set to the Fail_Safe value) and the OPERATE state (all outputs have the process value). The Master is usually switched into the CLEAR mode when, for instance, the PLC enters STOP.

Class 1 and Class 2 DP Masters

The Class 1 master refers to the controller that carries out cyclic I/O data exchange with the slaves, while a Class 2 master is a B&B device that generally only has read access to the slaves' I/O data.


PROFIBUS DPV1

PROFIBUS DPV1 refers primarily to the acyclic read and write telegrams, with which data sets in the slave are acyclically accessed. A distinction between a Class 1 and a Class 2 master is also made for DPV1. The difference between acyclic Class 1 (C1) and Class 2 (C2) connections is that the acyclic C1 connection is established during the DP StartUp phase of cyclic DP operation. Once the slave has reached the WAIT-CFG state it is possible for acyclic DPV1-C1 read and write telegrams to be sent from the master to the slave, whereas the C2 connection is established separately, independently of the cyclic DP connection. This is usually carried out by a second (C2) master so that, for instance, a manufacturer-specific project configuration and diagnostic tool can access the slave's data.

When two masters are used, however, is must always be borne in mind that these share bus access (a token is exchanged), so that time relationships are less favourable than in the case of a single master system.


PROFIBUS - Cables, Plugs and Switches

BECKHOFF Fieldbus Components: PROFIBUS

Cables, Plugs and Switches

The physics of the transmission

Physical aspects of the data transmission are defined in the PROFIBUS standard. See PROFIBUS layer 1 (physical layer).

The types of area where a fieldbus system can be used is largely determined by the choice of the transmission medium and the physical bus interface. In addition to the requirements for transmission security, the expense and work involved in acquiring and installing the bus cable is of crucial significance. The PROFIBUS standard therefore allows for a variety of implementations of the transmission technology while retaining a uniform bus protocol.

Cable-based transmission: This version, which accords with the American EIA RS-485 standard, was specified as a basic version for applications in production engineering, building management and drive technology. A twisted copper cable with one pair of conductors is used. Depending on the intended application area (EMC aspects should be considered) the screening may be omitted.

Two types of conductor are available, with differing maximum conductor lengths; see the „RS-485“ table. The pin assignment at the plug and the wiring are illustrated in the diagram. Note the special requirements on the data cable for baud rates greater than 1.5 Mbaud. The correct cable is a basic requirement for correct operation of the bus system. If a „simple“ 1.5 Mbaud cable is used, reflections and excessive attenuation can lead to some surprising phenomena. This could, for example be that some station is not connected, but when the neighboring station is unplugged the connection appears again. Or there may be transmission errors when a specific bit pattern is transmitted. The result of this can be that when the equipment is not operating, PROFIBUS works without faults, but that there are apparently random bus errors after start-up. Reducing the baud rate (< 93.75 kbaud) corrects this faulty behavior.

Cable-related malfunctions

If reducing the baud rate does not correct the error, then in many cases this can indicate a wiring fault. The two data lines maybe crossed over at one or more connectors, the termination resistors may not be switched on, or they may be active at the wrong locations.

Note 		Pre-assembled cables from Beckhoff
Installation is made a great deal more straightforward if pre-assembled cables from Beckhoff are used. Wiring errors are avoided, and commissioning is more rapidly completed. The range includes fieldbus cables, power supply cables, sensor cables and accessories such as terminating resistors and T-pieces. Connectors and cables for field assembly are nevertheless also available.
PROFIBUS Connection of the fieldbus box modules
The M12 socket is inverse coded, and has five pins. Pin 1 is 5 V DC and 3 is GND for the active termination resistor. These must never be misused for other functions, as this can lead to destruction of the device. Pin 2 and pin 4 are the PROFIBUS signals. These must never be swapped over, as this will prevent communication. Pin 5 is the shield, and this is capacitatively coupled to the Fieldbus Box chassis.
PROFIBUS socket pin assignment

PROFIBUS conductor colors
PROFIBUS conductors | M12 | D-Sub
B red | Pin 4 | Pin 3
A green | Pin 2 | Pin 8
RS485 - Fundamental properties
RS-485 transmission according to the PROFIBUS standard
Network topology | Linear bus, active bus terminator at both ends, stubs are possible.
Medium | Screened twisted cable, screening may be omitted, depending upon the environmental conditions (EMC).
Number of stations | 32 stations in each segment with no repeater. Can be extended to 127 stations with repeater
Max. bus length without repeater | 100 m at 12 Mbit/s 200 m at 1500 Kbit/s, up to 1.2 km at 93.75 Kbit/s
Max. bus length with repeater | Line amplifiers, or repeaters, can increase the bus length to the order of 10 km. The number of repeaters possible is at least 3, and, depending on the manufacturer, may be up to 10
Transmission speed | 9.6, 19.2, 93.75, 187.5, 500, 1500 Kbit/s, up to 12 Mbit/s, adjustable in stages
Plug connector | 9-pin D-Sub connector for IP20 M12 round plugged connector for IP65/67

Cabling for PROFIBUS DP and PROFIBUS FMS

Note 		Termination resistors at the conductor ends
In systems with more than two stations all devices are wired in parallel. It is essential that the bus cables are terminated with resistors at the conductor ends in order to avoid reflections and associated transmission problems.

Addressing

Setting of station addresses

The PROFIBUS address must be set using the two rotary selection switches behind the transparent cover. The default setting is 11. Any address is permitted, but each address may only be used once within the network. The address is changed while the Fieldbus Box is switched off. To do this, unscrew the cover and use a screwdriver to move the switches to the desired position. Make sure that the switches engage properly. The change in address is active as soon as the device is switched on.
Address Fieldbus Box

The switch on the left represents the tens, while that on the right represents the units.

AdressePB.jpg (19493 Byte)

Address Bus Coupler

The switch S311 represents the tens, while that S310 represents the units.


Topology

  • A bus segment may consist of a maximum of 32 devices (including the repeaters).
  • The maximum conductor length of a segment depends on the transmission speed in use and on the quality of the bus cables being used.
  • No more than 9 repeaters may be installed between two devices.
  • Stubs are to be avoided, and are not permitted above 1.5 Mbaud.
  • The maximum number of devices is 127
  • Interrupting the supply voltage from cable ends by switching off the repeater/slave, or by pulling out the plug, is not permitted.

Fig. 1: RS485 topology with 3 segments and 2 repeaters.


CX809x – LED indicators

BECKHOFF CX8030, CX8031: Error handling and diagnosis

LED indicators

Ethernet interface X001

Interface X001 | Ethernet (CX8030, CX8031) | Meaning
LED green | on | Link present
LED yellow | flashing | Activity

LED CX8030 Coupler

Labeling | Meaning | Color | Meaning
TC | Indicates the status of the coupler | red | TwinCAT is in "stop" mode
 |  | Green | TwinCAT is in "run" mode
 |  | Blue (If red DIP switch 1 is set to on when starting the coupler) | TwinCAT is in "config" mode
BF | Indicates the status of the PROFIBUS | Green on | PROFIBUS error-free
 |  | Green flashing | PROFIBUS, at least one slave in error
DIA | Indicates PROFIBUS errors | red illuminated | no PROFIBUS configured

LED CX8031 and CX8030 Couplers configured as slave

Labeling | Meaning | Color | Meaning
TC | Indicates the status of the coupler | red | TwinCAT is in "stop" mode
 |  | Green | TwinCAT is in "run" mode
 |  | Blue (If red DIP switch 1 is set to on when starting the coupler) | TwinCAT is in "config" mode
BF | Indicates the status of the PROFIBUS | Green on | PROFIBUS in data exchange
 |  | Green flashing | PROFIBUS is waiting for Cfg data
DIA | Indicates PROFIBUS errors | - | -

LED power supply terminal

Operation with K-bus terminals Operation with E-bus terminals

Display LED | Description | Meaning
1 Us 24 V (top left, 1st row) | CX80xx supply voltage | connected to -24 V
2 Up 24 V (top right, 1st row) | Power contacts supply voltage | connected to -24 V
3 L/A (left center, 2nd row) | EtherCAT LED | flashing green: EtherCAT communication active connected to E-bus / no data traffic not connected to E-bus
4 K-BUS RUN (right center, 2nd row) | K-bus LED RUN | Lights up green: K-bus running, everything OK
6 K-BUS ERR (bottom right, 3rd row) | K-bus LED ERR | Lights up red: K-bus error - see K-bus error code

K-bus error code

Error code | Error code argument | Description | Remedy
Persistent, continuous flashing EMC problems
  • Check power supply for undervoltage or overvoltage peaks
  • Implement EMC measures
  • If a K-bus error is present, it can be localized by a restart of the coupler (by switching it off and then on again)
3 pulses 0 K-bus command error
  • No Bus Terminal inserted
  • One of the Bus Terminals is defective; halve the number of Bus Terminals attached and check whether the error is still present with the remaining Bus Terminals. Repeat until the defective Bus Terminal is located.
4 pulses | 0 | K-Bus data error, break behind the Bus Coupler | Check whether the n+1 Bus Terminal is correctly connected; replace if necessary.
n | Break behind Bus Terminal n | Check whether the bus end terminal 9010 is connected.
5 pulses | n | K-bus error in register communication with Bus Terminal n | Exchange the nth bus terminal
6 pulses | 0 | Error at initialization | Exchange Bus Coupler
1 | Internal data error | Perform a hardware reset on the Bus Coupler (switch off and on again)
8 | Internal data error | Perform a hardware reset on the Bus Coupler (switch off and on again)
7 pulses | 0 | Process data lengths do not correspond to the configuration | Check the Bus Terminals for the configured Bus Terminals
1..n | K-bus reset failed | Check the Bus Terminals


CX80xx - First steps

BECKHOFF CX80xx: Appendix

First steps

The following components are necessary for the first steps

  • PC with TwinCAT 2.11 R3
  • Ethernet cable
  • Power supply (24 VDC), cabling material
  • a KL2xxx or an EL2xxx, digital output terminal, end terminal

Note 		Required TwinCAT version
TwinCAT 2.11 R3 is required for the programming of the CX80xx series. Older TwinCAT versions and TwinCAT 3.x are not supported!

1. Connect K-bus or E-bus terminals to the controller.

2. Connect voltage to the CX80xx (see power supply).

3. Connect Ethernet (CX80xx X001) to your network or a direct connection to your PC (make sure in the case of a peer-to-peer connection that the IP addressing in your PC is set to DHCP).

4. Wait a while, approx. 1 to 2 minutes; either the CX80xx will be assigned an address by the DHCP server (usually fast) or, if it does not find a DHCP server, it uses a local IP address.

5. Switch on TC on the PC in Config Mode (TwinCAT icon blue) and start the System Manager

6. In the System Manager, click on the PC symbol (Choose Target System) or press >F8<

7. The following dialog box opens; click on Search (Ethernet).

8. Select Option 1 if you have addressed via DHCP or Option 2 in case of DHCP or local IP address. Then click on “Broadcast search”.

Your network is scanned for Beckhoff controllers. If none is found, this means that the DHCP of the controller is not yet completed or the network settings on your PC are incorrect. A network cable that has not been connected can naturally also be the cause, but this should not be the case if point 3 has been done.

9. The host name is composed by default of “CX” and the last 4 bytes of the Mac address. You can find the MAC address on the side of the CX80xx. The MAC address is always 6 bytes long and the first three bytes are the vendor ID, which is always 00 01 05 in the case of Beckhoff devices.

An “X” next to connected means that the CX is already known in the system and can be used. To make it known, click in the list on the CX with which you want to connect and then click on “Add route”. An input mask opens with “User name” and “Password”. By default there is no password, simply confirm by clicking on OK. Afterwards the “X” should appear next to connected.

10. Next, the CX should appear in the list of the devices; select it and confirm by clicking on OK.

11. Check whether the connection is there. In the System Manager in the bottom right-hand corner. It must be blue or green and may not be yellow.

12. If the setting is green, switch the CX to Config Mode with “Shift F4” or click on the blue TC icon in the System Manager. The System Manager now asks you whether you really want to switch to Config Mode; confirm by clicking on OK.

13. The setting at the bottom right must now change to blue and the TC LED on the CX80xx must now also light up blue.

14. Now click on I/O Devices and then on Scan Devices...

15. A message appears, informing you that not everything will be automatically detected.

16. The CCAT interface is usually found (CX8090) or the corresponding fieldbus interface (other CX80xx devices) and either a K-bus interface or an EtherCAT interface, depending now on which terminals you have connected to the CX. The CCAT interface must be present in the System Manager file and may not be deleted. If an error message should appear when scanning, check the revision level of your TwinCAT version and perform an update if necessary.

17. Now we come to the programming. To do this, open the PLC Control and select File -> New. The PLC Control asks you for the target system. Select CX (ARM). Afterwards it asks you for the function block; set the ST language (structured text). Now write a small program...

Translate the program. If it is error free (a warning must come, that it is OK) save the project under an arbitrary name, translate it again and save it once again.

18: Switch once again to the System Manager and add the program under PLC Configuration. A FileName.typ file is sought.

19: Now open the project, then the task and then outputs, in which there must be a variable MAIN.bToggle. You can link this with the hardware. To do this, click on “Linked to...”.

Select a digital output. Now you can download the configuration to the CX and switch the CX to Run Mode. To do this, click on the ‘cube’ or press Ctrl + Shift + F4. The TC LED on the CX must then light up green.

20. Switch back to PLC Control, go to “Online/Selection of the target system”, select the correct CX, click on it and select runtime system 1. Now “Online/login” again (F11) transfer the PLC program, then “Online/Start” (F5). The LED on your terminal must now flash.

21. As a final step Online/Generate a boot project. This completes the project and your first program is stored on the CX.

Congratulations, the bases are now there and waiting to be built on. We wish you every success!


CX80xx Image Update

BECKHOFF CX80xx: Appendix

Image Update

There are two different possibilities to update the image of the CX80xx.

Notice 		Requirements
  • Please make sure before the update that your CX80xx supports the image that you want to load.
  • When updating the image, please first update all existing files and only then copy the new image.

Always copy all files and directories in order to update a CX80xx.

Update via USB

A USB cable is required for this!

  • Switch off the CX80xx
  • Set red dip switch (under the flap) DIP 1 to ON
  • Switch on the CX
  • Connect the PC with USB
  • Delete all files (we recommend that you backup all files first), no formatting
  • Wait until copying has finished, then remove the USB cable
  • Switch DIP switch 1 to OFF
  • Switch off the CX80xx
  • Switch on the CX80xx; it may take a little longer the first time

Update the MicroSD card

A MicroSD card reader is required for this!

  • Remove the MicroSD card from the switched-off CX device.
  • Insert the MicroSD card into the reader
  • Delete all files (we recommend that you backup all files first), no formatting
  • Load the new image
  • Wait until copying has finished, then remove the MicroSD card
  • Insert the MicroSD card into the SD slot of the switched-off CX again
  • Now switch on the CX again; it may take a little longer the first time


Bibliography

German books

PROFIBUS

  • PROFIBUS-DP/DPV1
    Grundlagen, Tipps und Tricks für Anwender (Principles, Tips for Users)
    by Manfred Popp
    ISBN: 3778527819

General fieldbus technology

  • Gerhard Gruhler (Pub.): Feldbusse und Geräte-Kommunikationssysteme (Fieldbus and Device Communication Systems)
    Praktisches Know-How mit Vergleichsmöglichkeiten (Practical Know-how with Comparative Resources)
    Franzis Verlag, 2001
    244 pages
    ISBN 3-7723-5745-8

English books

(in preparation)

PROFIBUS-DP standards

  • IEC 61158 and IEC 61784
  • DIN 19245, Part 3
  • Euronorm EN 50 170

Web sites

  • http://www.profibus.com


List of Abbreviations

DP

Distributed Peripherals. PROFIBUS protocol for fast cyclic data exchange

FMS

Fieldbus Message Specification. The PROFIBUS transmission protocol

Freeze mode

This command makes the slave freeze its inputs

GSD file

Basic device file (in German)

GSE file

Basic device file (in English)

IP20, IP65, IP66, IP67

Protection class (contact, water, dust)

K-Bus

Terminal bus - internal bus for communication between the coupler and Bus Terminals

PNO

PROFIBUS User Organisation

Repeater

Provides signal conditioning, connecting individual bus segments

PLC

Programmable logic controller

Sync mode

This command makes the slave hold its outputs unchanged until it receives the Sync telegram.


Support and Service

Beckhoff and their partners around the world offer comprehensive support and service, making available fast and competent assistance with all questions related to Beckhoff products and system solutions.

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.

Beckhoff Headquarters

Beckhoff Automation GmbH & Co. KG

Huelshorstweg 20
33415 Verl
Germany

Phone: | +49(0)5246/963-0
Fax: | +49(0)5246/963-198
e-mail: | info@beckhoff.com
Beckhoff Support

Support offers you comprehensive technical assistance, helping you not only with the application of individual Beckhoff products, but also with other, wide-ranging services:

  • support
  • design, programming and commissioning of complex automation systems
  • and extensive training program for Beckhoff system components
Hotline: | +49(0)5246/963-157
Fax: | +49(0)5246/963-9157
e-mail: | support@beckhoff.com
Beckhoff Service

The Beckhoff Service Center supports you in all matters of after-sales service:

  • on-site service
  • repair service
  • spare parts service
  • hotline service
Hotline: | +49(0)5246/963-460
Fax: | +49(0)5246/963-479
e-mail: | service@beckhoff.com


CX8031 - Introduction

The CX8031 is a controller with an Ethernet connection, via which it is programmed and/or configured, and a PROFIBUS interface on an RS485 basis with a D-sub connection. Physically the CX8031 has only one D-sub interface, but this can be used in such a way that it appears as if 4 devices are on the bus. The advantage of this is that more data can be exchanged and that the CX8031 can communicate as a DP/DP coupler with a second PROFIBUS master.

Alternatively K-bus or E-bus terminals can be series-connected; the CX8031 automatically detects which type of terminal is connected during the start-up phase. The control system is programmed with TwinCAT via the fieldbus interface or the additional Ethernet interface.

In the basic version the CX80xx contains a 512 MB MicroSD card. The basic equipment includes two Ethernet interfaces as well as a K-bus or E-bus interface.

The smallest task time to be used is 1 ms (a task time of 1 to 50 ms is recommended for the I/O data, further tasks can also be set slower). When using shorter cycle times, the total system utilization rate is to be observed. If too short a cycle time is selected, the Web visualization and remote desktop may operate very slowly or cause timeouts. The user is responsible for projecting and configuring his system such that it is not overloaded.


CX8031 – LED displays

BECKHOFF CX8031: Commissioning LEDs

LED displays

Ethernet interface X001

Interface X001 | Ethernet (CX8093) | Meaning
LED green | on | Link present
LED yellow | flashing | Activity

LED coupler

Labeling | Meaning | Color | Meaning
TC | Indicates the status of the coupler | red | TwinCAT is in "stop" mode
 |  | Green | TwinCAT is in "run" mode
 |  | Blue (If red DIP switch 1 is set to on when starting the coupler) | TwinCAT is in "config" mode
BF | Indicates the status of the PROFIBUS | Green on | PROFIBUS is exchanging data
 |  | Green flashing | PROFIBUS is waiting for Cfg data
DIA | Indicates PROFIBUS errors | - | -

LED power supply terminal

Operation with K-bus terminals Operation with E-bus terminals

Display LED | Description | Meaning
1 Us 24 V (top left, 1st row) | CX80xx supply voltage | connected to -24 V
2 Up 24 V (top right, 1st row) | Power contacts supply voltage | connected to -24 V
3 L/A (left centre, 2nd row) | EtherCAT LED | flashing green: EtherCAT communication active connected to E-bus / no data traffic not connected to E-bus
4 K-BUS RUN (right centre, 2nd row) | K-bus LED RUN | Lights up green: K-bus running, everything OK
6 K-BUS ERR (bottom right, 3rd row) | K-bus LED ERR | Lights up red: K-bus error - see K-bus error code

K-bus error code

Error code | Error code argument | Description | Remedy
Persistent, continuous flashing EMC problems
  • Check power supply for undervoltage or overvoltage peaks
  • Implement EMC measures
  • If a K-bus error is present, it can be localised by a restart of the coupler (by switching it off and then on again)
3 pulses 0 K-bus command error
  • No Bus Terminal inserted
  • One of the Bus Terminals is defective; halve the number of Bus Terminals attached and check whether the error is still present with the remaining Bus Terminals. Repeat until the defective Bus Terminal is located.
4 pulses | 0 | K-Bus data error, break behind the Bus Coupler | Check whether the n+1 Bus Terminal is correctly connected; replace if necessary.
n | Break behind Bus Terminal n | Check whether the Bus End Terminal 9010 is connected.
5 pulses | n | K-bus error in register communication with Bus Terminal n | Exchange the nth bus terminal
6 pulses | 0 | Error at initialization | Exchange Bus Coupler
1 | Internal data error | Perform a hardware reset on the Bus Coupler (switch off and on again)
8 | Internal data error | Perform a hardware reset on the Bus Coupler (switch off and on again)
7 pulses | 0 | Process data lengths do not correspond to the configuration | Check the Bus Terminals for the configured Bus Terminals
1..n | K-bus reset failed | Check the Bus Terminals


CX8031 – Technical data

BECKHOFF CX8031: Product overview

Technical data

Technical data | CX8031
Processor | 32 bit, 400 MHz, ARM9
Internal main memory | 64 MB RAM (internal, not extendable)
Operating system | Microsoft Windows CE 6.0
Web-based Management | yes
Flash memory | MicroSD card (ATP) 512 MB (optionally 1, 2, 4 GB)
Interfaces | 1 x USB device (behind the front flap) 1 x RJ45 Ethernet, 10/100 MBit/s (ADS over TCP/IP) 1 x D-sub RS485 PROFIBUS
Protocols | PROFIBUS
Interface for I/O terminals | K-bus or E-bus, automatic recognition
Process data on the K-Bus | max. 2 KB input data max. 2 KB output data
Diagnostics LED | 1 x power, 1 x TC status, 2 x bus status
Clock | internal battery-backed clock (RTC) for time and date (battery exchangeable)
Operating system | Microsoft Windows CE
Control software | TwinCAT PLC runtime (from version 2.11 R3)
Programming | TwinCAT PLC
Programming languages | IEC 61131-3
Online Change | Yes
Up/download code | Yes/Yes
Power supply | 24 VDC (-15 %/+20 %)
UPS | 1-second UPS
Power supply for I/O terminals | max. 2 A
Max. power loss | 3.0 W (including system interfaces)
Dielectric strength | 500 V (supply / internal electronics)
Dimensions (W x H x D) | 64 mm x 100 mm x 73 mm
Weight | approx. 180 g
Permissible ambient temperature during operation | 0 °C to +55 °C
Permissible ambient temperature during storage | -25 °C to +85 °C
Installation position | See chapter Installation positions
Relative humidity | 95 % no condensation
Vibration / shock resistance | conforms to EN 60068-2-6 / EN 60068-2-27
EMC immunity/emission | conforms to EN 61000-6-2 / EN 61000-6-4
Protection class | IP20
System data | PROFIBUS (CX8031)
Number of I/O modules | 100 with repeater
Number of I/O points | approx. 6.000, depending on the master
Transmission medium | screened copper cable, 2 x 0.25 mm²
Cable length | 1200 m | 1000 m | 400 m | 200 m | 100 m
Data transfer rate | 9.6/19.2/93.75 kbaud | 187.5 kbaud | 500 kbaud | 1500 kbaud | 3 /6 /12 Mbaud
Topology | Line topology