PLC-integration via Ethercat (Beckhoff) PLC-integration via Ethercat (Beckhoff) | HBM

Configuration demo for PMX and read/write consistent data via EtherCat using TwinCat

This short example considers a simple configuration demo for the PMX amplifier connected to a PC EtherCAT-master PLC with TwinCat, who is working as EtherCat master.

Introduction

In this example, consistent (coherent) data are written and read via EtherCat.

Connection

The PMX is equipped with EtherCat interface PX01EC (Slot 0) and measuring boards PX878 slot 1, PX455 slot 2 (strain gauge sensors e.g. force) and PX401 slot 3 (analog signals +/-10V or +/-20mA).

Connect the Ethernet-Port of the PC using RJ45 cable to the PMX EtherCat-interface board (PX01EC slot 0). Power on both devices.

Program start

Open the TwinCat software.

There are two ways to add a device:

Option 1: Load XML file (time-consuming)

Option 2: Scan for devices via icon from menu bar (quick)

Both options will be described separately below. They are not compatible but are instead optional.

Option 1: "Load XML file" (time - consuming)

First of all, the XML file must be available. Use the following path to load the file:

To load the XML file, right-click Device1 and choose "Append Box". The following dialog opens which enables you to scan for a PMX system.

When the PMX system has been added to the hierarchy on the left-hand side, the slots need to be assigned to the respective measuring cards.

For this purpose, (1) select the slot, (2) select the measuring card inserted into the slot and (3) assign the measuring card to the slot. This results in the following overview:

Repeat these steps for all other slots.

The next step is to assign the Calculated Channels. It is essential to make sure that the number of channels set in TwinCat is equal to the number of calculated channels in the PMX web browser. (In this case: 8 channels)

4 calculated channels are assigned per virtual "Calculated Channel'.

When all measuring cards and Calculated Channels have been assigned, our example provides the following overview:

Now the PMX values can be linked to the variables in the system configuration's Cyclical Data. In this case, “Wert 1” (value 1) is linked to “Var 66”.

Click the "Linked to" button to get the following window, where you can select the variable to belinked.

The 'Activate Configuration' icon starts data exchange. Diverse messages are displayed which have to be confirmed with 'Yes' or 'OK'.

Click Device to display the current measured values (see fig. below). “Wert 1” shows a force sensor value.

Option 2 "Scan for devices" (quick )

The XML file must not be loaded. It has to be renamed in the directory for this purpose. In this case, "doNotUse" has been added as file extension.

Scan for devices in TwinCat

The PMX system is automatically found with the channels and measuring cards having already been configured.

The measured values of the card must be linked to the variables.

Click 'Activate Configuration' to start data exchange.

The subsequent messages must be confirmed.

The measured values are displayed.

Disclaimer

The example given is intended to illustrate the integration of PMX into Beckhoff TwinCat software via EtherCat. This example does not imply any warranty or guarantee.