Skip to main content

Beckhoff PLC

A Beckhoff CX controller or Industrial PC running TwinCAT can communicate with Reniway Edge through the TwinCAT ADS connector. This example walks through the PLC-side ADS route first, then the Reniway Edge connector setup.

Beckhoff CX9020 PLC structure

What you need

NecessitiesDescription
Reniway EdgeThe edge device or server that will connect to the PLC.
Network connectionEthernet connection between Reniway Edge and the Beckhoff PLC network.
Beckhoff PLC or IPCA Beckhoff controller running TwinCAT.
PLC IP addressStatic or reserved IP address of the Beckhoff PLC.
PLC AMS Net IDThe AMS Net ID of the Beckhoff PLC.
Reniway AMS Net IDThe local AMS Net ID configured for Reniway Edge.
ADS route accessAccess to the Beckhoff Device Manager, TwinCAT XAE, or another route manager on the PLC.
PLC runtime ADS portUsually 851 for TwinCAT 3 PLC runtime 1, or 801 for TwinCAT 2 PLC runtime 1.

Example values

Use the values from the customer network. The table below is only an example layout.

ItemExample value
Reniway Edge IP address192.168.101.50
Reniway AMS Net ID192.168.101.50.1.1
Beckhoff PLC IP address192.168.101.207
Beckhoff PLC AMS Net ID192.168.101.207.1.1
PLC runtime ADS port851

Preparing the Beckhoff PLC

Start by making sure the PLC and Reniway Edge can reach each other on the network. The PLC should have a stable IP address and the Reniway Edge IP address should not change after the route is created.

Find the PLC AMS Net ID

Open the Beckhoff Device Manager or TwinCAT route configuration for the PLC and note the PLC AMS Net ID.

On TwinCAT/BSD systems, the Beckhoff Device Manager is available in a browser:

https://[plc-ip-address]

In the Device Manager, open TwinCAT and then Connectivity. The PLC AMS Net ID is shown on the same page where ADS routes are managed.

Check the Reniway AMS Net ID

Open Reniway Edge and go to Settings > Connectors > TwinCAT ADS Connector.

Copy the Local ADS Net ID. This is the AMS Net ID that must be entered in the Beckhoff PLC route table. If you change it, apply the setting before creating or updating the PLC route.

For more details, see TwinCAT ADS Connector settings.

Add the ADS route on the PLC

In the Beckhoff Device Manager, open TwinCAT > Connectivity and add a route for Reniway Edge.

Add TwinCAT ADS route for Reniway Edge

Fill in the route settings:

SettingValue
Route NameA clear name, for example Reniway Edge.
AMS Net IDThe Reniway AMS Net ID, for example 192.168.101.50.1.1.
Transport TypeTCP_IP.
AddressThe Reniway Edge IP address or hostname.
Connection Timeout (ms)Use the site standard, for example 5000.
TemporaryLeave disabled so the route remains after a restart.

Save the route. If the PLC asks for a restart of TwinCAT, the ADS router, or the controller, schedule it with the machine owner before continuing.

Check ADS network access

The PLC must accept ADS traffic from Reniway Edge. For classic ADS/TCP, the firewall path to the PLC must allow TCP port 48898.

Do not confuse this with the Reniway connector Port field. In the Reniway connector, 851 means "TwinCAT 3 PLC runtime 1". The TCP firewall port for ADS/TCP is normally 48898.

On TwinCAT/BSD systems, unencrypted ADS/TCP can be disabled by firewall policy. If the connection times out even though the route is correct, check the Beckhoff firewall and site security policy.

Reniway Edge connection

Open Reniway Edge and add a new field connector.

Fill in the connector settings:

SettingValue
NameA clear name, for example Beckhoff PLC.
TypeTwinCAT ADS.
IP AddressThe IP address of the Beckhoff PLC.
PLC Net IDThe AMS Net ID of the Beckhoff PLC.
PortThe PLC runtime ADS port, usually 851 for TwinCAT 3 runtime 1.
Reniway Edge TwinCAT ADS connector settings for a Beckhoff PLC

Save the connector and start the connection.

Add PLC properties

After the connector is connected, add the PLC symbols that Reniway Edge should read.

Typical first test symbols are simple scalar values from the PLC program, for example:

PLC symbolExample purpose
MAIN.MachineStateCurrent machine state number.
MAIN.MotorTemperatureLive motor temperature.
MAIN.ProductCounterProduced-parts counter.
MAIN.ScrapCounterScrap-parts counter.

Use symbol names that exist in the deployed TwinCAT PLC project. If a symbol cannot be read, verify the PLC project, symbol visibility, runtime state, and the selected ADS port.

Validation

After the connector is connected, check a few live values in Reniway Edge:

  • The connector status is connected.
  • The PLC symbols return values instead of errors.
  • Values update when the PLC program changes them.
  • Counters increase when the machine or test program runs.
  • The connector reconnects after a short PLC or network interruption.

Troubleshooting

SymptomPossible causeSolution
Reniway Edge cannot connectMissing route on the Beckhoff PLCAdd a route on the PLC that points to the Reniway AMS Net ID and IP address.
Connection times outADS/TCP is blocked by firewall or routingVerify network routing and allow TCP 48898 to the PLC for classic ADS/TCP.
Connection is rejectedWrong Reniway AMS Net ID in the PLC routeCompare the route AMS Net ID with Settings > Connectors > TwinCAT ADS Connector in Reniway Edge.
Connector connects to the wrong runtimeWrong ADS portUse 851 for TwinCAT 3 PLC runtime 1, or the runtime-specific port used by the PLC project.
Symbols cannot be readWrong symbol name or PLC project stateVerify the symbol path in TwinCAT and confirm the PLC runtime is running.
Works until restartRoute was temporaryRecreate the route with Temporary disabled.

Result

The Beckhoff PLC is now prepared for TwinCAT ADS communication and can be used as a live PLC data source in Reniway Edge.