Beckhoff TwinCAT: A PC-Based PLC for Remote Access
Beckhoff stands out from traditional PLC manufacturers thanks to its PC-based architecture: CX controllers and industrial PCs run TwinCAT Runtime on Windows IoT or Windows 10/11. This approach offers significant advantages for remote access:
- Windows Network Connectivity: Remote Desktop, file sharing, web access—all Windows tools are available
- TwinCAT 3 Remote Manager: a dedicated tool for managing remote connections
- Native OPC UA: built-in OPC UA server; no third-party middleware required
- Python, .NET, C++: the Windows development ecosystem enables sophisticated IoT integrations
ADS/AMS Protocol: How It Works
The ADS (Automation Device Specification) protocol is TwinCAT’s proprietary communication layer. Here are its key concepts:
AMS Net ID: Each TwinCAT device is identified by an AMS Net ID in the format a.b.c.d.e.f (6 bytes). By convention, it is often derived from the IP address: an IP address of 192.168.1.10 results in an AMS Net ID of 192.168.1.10.1.1.
ADS Ports: Within a device, each TwinCAT runtime or service is accessible via an ADS port number (851 for PLC Task 1, 852 for PLC Task 2, etc.).
ADS Route: For a TwinCAT client to communicate with a remote runtime, you must create an ADS route—an entry in the routing table that associates an AMS Net ID with a network IP address.
For remote access via VPN, the ADS route points to the PLC’s IP address within the VPN network.
Beckhoff Product Line Compatible with Remote Access
| Product | Description | TwinCAT | Ethernet |
|---|---|---|---|
| CX9020 | Compact DIN-rail embedded PC, ARM | TC2/TC3 | 2 × Ethernet |
| CX5100 | Intel Atom embedded PC | TC2/TC3 | 2 × Ethernet |
| CX5200 | Intel Core i embedded PC | TC3 | 2 × Ethernet |
| CX8090 | Embedded PC with EtherCAT switch | TC3 | 2 × Ethernet |
| C6015 | Ultra-compact industrial PC | TC3 | 2 × Ethernet |
| EK9000 | EtherCAT/Modbus TCP coupler | — | 1 × Ethernet |
Beckhoff industrial CX and PC devices are the typical targets for remote access via TwinCAT. The EK/BK devices are field couplers, not targets for direct programming.
Configuring TwinCAT 3 Remote Access
Step 1: Prepare the Network Environment Make sure the VPN is active and that you can ping the IP address of the remote CX.
Step 2: Add an ADS Route In TwinCAT XAE (Visual Studio), go to the System tab and select "Routes." Click "Add Remote Route" and enter the following:
- Remote Name: descriptive name (e.g.,
Site_Lyon_CX5200) - AMS Net ID: the CX’s AMS Net ID (found in the TwinCAT Control Panel)
- Transport: TCP/IP
- Address: the CX’s IP address within the VPN tunnel
Step 3: Enable the route on the remote CX On the remote CX (accessible via Remote Desktop or by asking a local technician), add the reverse route from the CX to the engineer’s workstation.
Step 4: Connect Online In TwinCAT XAE, open the configuration (F4) and connect online. The project synchronizes with the remote runtime.
Beckhoff OPC UA for SCADA Monitoring
The TC3 OPC UA (TwinCAT 3 OPC UA) server automatically exposes variables marked as OPC UA in the PLC program. Configuration:
- Install the TC3 OPC UA package from the TwinCAT Package Manager
- Configure the listening port (4840 by default) and the security settings
- Tag the PLC variables with the
{attribute 'OPC.UA.DA' := '1'}attribute - From the SCADA client, connect to
opc.tcp://[IP_CX]:4840
When using a VPN, the OPC UA URL uses the CX’s IP address within the tunnel.
Security for Beckhoff Systems via Remote Access
Beckhoff CX systems run on Windows—Windows best practices apply in addition to OT best practices:
- Remote Desktop: If enabled, use only via a VPN tunnel. Change the RDP port (3389) to a non-standard port if it is exposed.
- Windows Firewall: Create restrictive rules for the ADS (48898) and OPC UA (4840) ports—access allowed only from IP addresses within the VPN tunnel.
- Antivirus: Beckhoff recommends industry-specific solutions (Trend Micro, Windows Defender with TwinCAT exclusions).
- Updates: Windows IoT LTSC receives security updates—schedule them during machine downtime.