PROFINET device integration under TwinCAT 2.11

This description applies to the PROFINET DEVICE Supplement.

PROFINET device integration under TwinCAT 2.11 1:

Installation

For a correct installation at least TwinCAT 2.11 build 1546 should be installed. With older TwinCAT versions we recommend an update. In other cases please contact Beckhoff Support.

1. Integration of the PROFINET protocol

A PROFINET device must first be added.

PROFINET device integration under TwinCAT 2.11 2:
"Insert Device" dialog
PROFINET device integration under TwinCAT 2.11 3:

Network card

If no card is found, either the TwinCAT is not in Config mode, or the real-time Ethernet driver has not been installed properly.

This interface must be assigned to an adaptor class. This is composed of the MAC and IP address of the network card. Look for the corresponding network card by using "Search".

PROFINET device integration under TwinCAT 2.11 4:
Search button, network card selection

MAC Address:
MAC address of the Ethernet card (read-only)

IP address
:
IP address of the card (read-only). The IP address is read from the operating system, and has nothing to do with the PROFINET IP address that will be used later.

PROFINET device integration under TwinCAT 2.11 5:

IP address of the network card

Please note that the IP address of the PROFINET device and the IP address of the Ethernet card are not identical! The PROFINET driver works with a virtual IP address that must not be identical to the IP address of the operating system!  

Promiscuous Mode:
This is required in order to record Ethernet frames, and should normally be switched off.

Virtual Device Names:
A virtual name is used for the network card.

Shared Adapter Interface:
Is included for compatibility reasons, but cannot be used with PROFINET.

Free Cycle:
Cycle time in Config mode (no real-time). If TwinCAT is operated in FREERUN mode, care must be taken that the freerun cycle set is no longer than the PROFINET cycle!

If, e.g., a CX9000 is to be parameterized, the target system must first be accessed remotely; the corresponding Ethernet port can subsequently be selected.

The NetID used can be found under the "Protocol" tab. It is, e.g., necessary for an ADS access. Besides that, there is a possibility in the "Sync Task" tab to append a free-running task for PROFINET communication (this is recommended). This allows the RealTime communication to run independently of a PLC task. For performance reasons, however (e.g. in the case of a CX9000), the Sync Tasks can be dispensed with and standard mapping takes place, i.e. a PLC task, for example, must be running in order for PROFINET communication to be possible.

A PROFINET protocol is then added by means of the right mouse button. Precisely one TwinCAT device protocol can be appended!

PROFINET device integration under TwinCAT 2.11 6:
Inserting a PROFINET protocol (TwinCAT device protocol)

A Box in the form of a GSDML is then integrated (right mouse button on "PROFINET Device").

PROFINET device integration under TwinCAT 2.11 7:
"Insert Box" dialog

Integration with any Ethernet interface without port diagnosis according to Version 2.0 without LLDP.

PROFINET device integration under TwinCAT 2.11 8:
Integrating any Ethernet interface without port diagnosis

Integration with a simple Ethernet interface (without switch, for example the CX1010 or FC90xx) with port diagnosis according to Version 2.1.

PROFINET device integration under TwinCAT 2.11 9:
Integrating a simple Ethernet interface with port diagnosis

Integration with a switched Ethernet interface (the CX1020, for example) with port diagnosis according to Version 2.1.

PROFINET device integration under TwinCAT 2.11 10:
Integration with a switched Ethernet interface with port diagnosis

Virtual PROFINET device

It is also possible in TwinCAT to configure a number of virtual PROFINET devices (a maximum of 7 in the Supplement, and 1 in the EL6631-0010). Each device is again to be viewed as its own adaptor, i.e. each virtual device is assigned a default MAC address from a reserved range. To avoid possible address conflicts, the last byte of the MAC address of virtual devices can also be changed. The name which the device was given in the strand (or in the "General" tab) is also taken as a PROFINET station name following a restart. On the basis of different MAC addresses and names, a PROFINET controller can now distinguish several devices in the strand.

It is therefore possible to use 8 devices per Ethernet interface in the PROFINET Device Supplement, and to communicate with 8 different PROFINET controllers.

In PROFINET, different user profiles can be defined within a device (API - Application Process Instance). Precisely one API is permitted / supported for each device in TwinCAT.

In accordance with PROFINET, the DAP (Device Access Point) is always defined on slot 0. Device-specific data is defined in it. In accordance with PROFINET, several DAPs can be defined; however, in TwinCAT there is currently precisely one!

2. Process data

The process data can be inserted from slot 1. This takes place by integrating the desired module in the API. Each module (slot) has at present precisely one sub-module (sub-slot). The configuration of the modules and hence the creation of the process data image on the PROFINET side takes place by means of specifying data types / data widths (e.g. byte, word, dword, float 32).

The designation of the inputs and outputs always takes place in TwinCAT from the TwinCAT point of view, i.e. the inputs are from the PROFINET point of view (from the controller) the outputs! Therefore the data of the PROFINET I/O devices is represented as follows:

PROFINET device integration under TwinCAT 2.11 11:
Representation of the input/output data of the PROFINET I/O device

This representation applies only to the TwinCAT PROFINET device, in the case of a TwinCAT PROFINET controller, the view will correlate again!

3. General settings

The instance ID can be changed on the "PROFINET Devices" tab. However, the default settings suffice for normal operation!

PROFINET device integration under TwinCAT 2.11 12:
"Device" tab

There is one further way of assigning the PROFINET station name. This is comparable with the DIP switches in the BK9103 and can be carried out via a PLC task. For activation, "Generate Station Name from Control" must be activated. For clarification, 000 will be appended to the previous tree name (default: "tcpniodevice").

PROFINET device integration under TwinCAT 2.11 13:

Tree name

This tree name no longer corresponds to the PROFINET station name! The Ctrl WORD of the PROFINET protocol is used to help assign a name. This means that the number that is entered (range of values 0 - 255) is appended to the existing station name. In addition, the Ctrl WORD must be linked to a task. It is subsequently necessary to restart TwinCAT. If, e.g., the task now specifies a value of 11 for the linked Ctrl WORD, its previous station name will change from, for example, "tcpniodevice" to "tcpniodevice011". The current tree name remains "tcpniodevice000".

The current station names and the IP configuration used can be checked via the "PROFINET diagnosis" tab.

4. Cycle times

The device can be operated in the minimum cycle time of 1 ms defined by PROFINET!

PROFINET device integration under TwinCAT 2.11 14:
"Adapter" tab, setting the cycle time

If TwinCAT is to be operated in RUN mode, a task must be created. In the simplest case, this is the aforementioned SyncTask. The call time for the task must not be longer than the PROFINET cycle time! If a second task is created, e.g. for the PLC, this can also run more slowly.

PROFINET device integration under TwinCAT 2.11 15:
Creating a task in the TwinCAT tree

In the case of less powerful devices (e.g. CX1000, CX9000 with E-bus), the CPU load may reach its limits. However, the performance can be improved again by means of the following considerations/measures: