Connections
Connect to a PLC (TwinCAT / ADS)
Set up the ADS connection to your Beckhoff TwinCAT PLC and bind widgets to its variables.
El Mirador talks to Beckhoff TwinCAT PLCs over ADS. Values arrive through ADS notifications, so widgets update the moment a variable changes, and inputs write straight back to the PLC.
What you need
- The TwinCAT ADS router on this PC. El Mirador connects through the ADS router that comes with TwinCAT (XAE or XAR), or the standalone TC1000 ADS router. Nothing else needs installing.
- An ADS route to the PLC, if the PLC runs on another machine. Add it in TwinCAT on this PC (right-click the TwinCAT icon in the system tray → Router → Edit Routes → Add) and make sure it's accepted on the PLC.
- The PLC's AMS Net ID, e.g.
5.42.118.20.1.1. It's shown in the route list and in the PLC's TwinCAT system settings. For a PLC running on this same PC, use this PC's own AMS Net ID. - The ADS port of the PLC runtime:
851for the first TwinCAT 3 PLC runtime,852for the second, and so on (801on TwinCAT 2).
Connect
- Open Project Settings (the gear at the bottom of the activity bar) and go to Connections → ADS.
- Enter the AMS Net ID and the Port (851 by default).
- Click Connect. The status changes to Online.
The standard refresh rate - 50 ms by default - is how often the PLC sends changes for widgets that don't set their own rate. 0 means as fast as possible.
Bind a widget to a variable
Select a widget and set its PLC variable in Properties, for example MAIN.bMotorRunning. While El Mirador is connected, the field suggests matching symbols as you type.
- Variable names include the program or global variable list:
MAIN.nCounter,GVL.bAlarm. - Display widgets show the value; inputs such as buttons, switches, sliders and fields also write it.
The connection in exported apps
The AMS Net ID and port are saved with the project and built into apps you export, so an exported app connects to the same PLC on its own. The panel PC it runs on needs the same two things as the builder: a TwinCAT ADS router and a route to the PLC.
Troubleshooting
- "Timeout has occurred - the remote terminal is not responding" - check the network cable and IP settings, and that the ADS route exists on both sides.
- Connect fails straight away - make sure TwinCAT's ADS router is running on this PC (the TwinCAT icon in the system tray).
- A variable isn't found - check the spelling, including the program name. After an online change that adds variables, disconnect and connect again to reload the symbol list.
Still stuck?
Send us a message with screenshots or your project file.