Beckhoff TwinCAT 3

Updated: from version 1.11

PlantBeat reads and writes values from Beckhoff PLCs with TwinCAT 3 via ADS. Dashboards, history, alarms, controls and reading with enable flag and done flag work the same as with Siemens.

You do not need a separate license for Beckhoff. One PlantBeat license covers all manufacturers, even though the card in the settings is called "Siemens driver license". Trial mode applies the same way as for Siemens.

Note

For now, the "Records" page is available for Siemens only. Values, history, alarms and dashboards already work fully with Beckhoff.

Try it without a PLC

In the connection wizard, choose the manufacturer Beckhoff TwinCAT (ADS) and enter demo as the address. You get a built-in demo PLC, with no network and no route. In the symbol tree you find, among other things:

  • GVL_Demo with changing values such as nZaehler, rTemperatur and lrDruck, a structure stMotor and arrays,
  • GVL_Handshake for practicing the enable flag and done flag: enable flag bFreigabe = true, done flag bFertig = true. After each done flag, the next record is ready 2 seconds later,
  • the program MAIN.

Connect to a real PLC

  1. "Connections" page, New connection, manufacturer Beckhoff TwinCAT (ADS).
  2. Enter the Name and the IP address or host name of the controller, that is, the address of the Beckhoff IPC or CX controller running TwinCAT 3.
  3. AMS Net ID of the controller: PlantBeat suggests the IP address + ".1.1". If it differs, you find it in TwinCAT under SYSTEM → Routes or in the router of the PLC.
  4. AMS port: 851 is the first PLC runtime, 852 the second, and so on. Default 851.
  5. Create the route on the PLC (next section).
  6. Test connection, then Next ›, and select the variables in the symbol tree.

Create a route on the controller

A TwinCAT PLC only answers ADS once it knows a route to PlantBeat. The wizard shows the instructions under Create a route on the controller, with the details of this device. You enter the route on the PLC once:

  1. In TwinCAT XAE under SYSTEM → Routes → "Add", or on the IPC via the TwinCAT icon → Router → Edit Routes.

  2. Add a static route with the details from the wizard:

    Setting Value
    AMS Net ID the AMS Net ID of PlantBeat, shown in the wizard
    Address the IP address of PlantBeat, enter it as an IP address, not as a host name
    Transport TCP/IP
    Route name any name, e.g. PlantBeat
    Address Info choose "IP Address"
    Remote Route "None / Server"
  3. Save, then click Test connection in the wizard.

If PlantBeat does not appear in the search ("Broadcast Search"), enter the address and AMS Net ID manually. PLCs with TwinCAT/BSD have no TwinCAT icon. There you create the route via TwinCAT XAE.

Tip

PlantBeat needs a fixed IP address or a DHCP reservation. If the address changes, you must adjust the route on every PLC.

If TwinCAT is installed on the Windows computer running PlantBeat, PlantBeat uses its ADS router. You then create the route in the TwinCAT of this computer, and its AMS Net ID applies. The wizard tells you this.

Change own AMS Net ID

Under Change own AMS Net ID you set the AMS Net ID of PlantBeat itself, or you choose "Automatic". This applies to all Beckhoff connections of this device. Running Beckhoff connections reconnect afterwards, and the routes on the PLCs must point to the new AMS Net ID.

Security

Without an installed TwinCAT, PlantBeat uses a built-in ADS router without ADS Secure. Therefore, run Beckhoff connections in an isolated plant network. PlantBeat reaches the PLC via TCP port 48898. A firewall in between must let this port through.

If it does not work

Message What helps
"No answer from … Usually the route to PlantBeat is missing on the controller" Create or check the route. Otherwise check the address, AMS Net ID and AMS port of the PLC.
"The AMS Net ID consists of six numbers from 0 to 255 separated by dots" Enter the AMS Net ID in the format 192.0.2.20.1.1.
"The AMS port must be between 1 and 65535 (default 851)." Correct the AMS port.

Next steps