iRidi for Beckhoff ADS
Tools for creating a visualization interface.
The driver controls Beckhoff ADS equipment. Use the example project to get started:
Example: iRidi Beckhoff
Description
iRidi for Beckhoff provides tools for creating a home or office control interface based on equipment of the same name.
Connection
Control panels (iOS, Android, Windows, Mac) can control Beckhoff equipment only through a Beckhoff controller. Select the controller as the Target device in TwinCat System Manager.

Adding the driver manually
To get started, add the BACnet driver from the iRidi database:
- Start iRidi Studio and create a new iRidi project.
- Open Devices in the sidebar and select Beckhoff ADS.

Specify the controller address in the iRidi project; otherwise, it will not work.
Configuring connection parameters
Configure connection settings after adding the driver.

- Host: Controller IP address.
- Port: Controller connection port.
- Keep Alive: TCP connection check interval. If a Keep Alive request receives no response, the driver is forcibly disconnected.
- Net ID: BACnet controller identifier. Find it in the controller settings in TwinCat System Manager: SYSTEM - Configuration - CX Settings - AmsNetId.
- Send Timeout: Beckhoff controller request send timeout in milliseconds.

Changing connection parameters
You need to change connection parameters when you disconnect from the automation site's Wi-Fi network and start using 3G or another Wi-Fi network. For control to continue working, switch from the local IP address to the Internet router's public IP address.
Switching is not automatic; you need to press the connection mode selection button. For remote access, the automation system's control ports must be made public. To do this, configure Port Forwarding on the Internet router. A VPN can provide a secure connection.
-
Download template (*.js) (right-click to save the target), then add the template to the script editor
using (+) Add Script from file.
-
Configure the script parameters as shown in the example:
function Internal_1() {
IR.GetDevice('Beckhoff').SetParameters({Host: "192.168.0.95", Port: 5001, TargetNetID: "5.9.57.45.1.1", "SendTimeout":20});
}
function External_1() {
IR.GetDevice('Beckhoff').SetParameters({Host: "215.110.10.10", Port: 5001, TargetNetID: "5.9.57.45.1.1", "SendTimeout":20});
}
Copy the driver name from Project Device Panel and copy the parameter list exactly from the example.
- Select the button that switches between Internal and External parameters. Open
Macros Editorfor the Press event (Object Properties > Programming), selectScript Calland add it by double-clicking. Select the function the button calls:

Each button press now applies the corresponding connection settings.
Commands & Feedbacks

Configure Commands and Feedbacks to control equipment. To send a command, drag it onto a graphical item and specify the Value to send. To display a feedback channel value, drag the Feedback onto a graphical item and specify how to display the Value.
For more information about graphical items, see the article "Graphical item types".
Configuration
Configure a command or feedback by setting these fields:
- Target Port: Port for accessing the variable.
Port assignments:
| Name | Port |
|---|---|
| Logger | 100 |
| Event Logger | 110 |
| IO | 300 |
| Additional Task 1 | 301 |
| Additional Task 2 | 302 |
| NC | 500 |
| PLC RC 1 | 801 |
| PLC RC 2 | 811 |
| PLC RC 3 | 821 |
| PLC RC 4 | 831 |
| Canshaft Contr | 900 |
| System Service | 10000 |
| Scope | 14000 |
-
Type: Variable type specified in TwinCat System Manager when creating a channel or tag. iRidi supports these types:
Type Length, bits Description BOOL 1 Boolean BYTE 8 Set of 8 bits WORD 16 Set of 16 bits DWORD 32 Set of 32 bits LWORD 64 Set of 64 bits SINT 8 Signed integer USINT 8 Unsigned integer INT 16 Signed integer UINT 16 Unsigned integer DINT 32 Signed integer UDINT 32 Unsigned integer LINT 64 Signed integer ULINT 64 Unsigned integer REAL 32 Floating point LREAL 64 Floating point STRING User-defined length String
Find the variable type in its settings in TwinCat System Manager:

- PLC Var Name: Variable name assigned when created in TwinCat System Manager.
To access global variables in GLOBAL (including physical inputs and outputs), prefix the variable name with a dot. For example, a global TwinCat variable named SwitchButton must be specified in iRidi as .SwitchButton.

Configuring simultaneous Beckhoff controller access from different devices
In TwinCat System Manager, add your IP address to the allowed list: SYSTEM -> Configuration -> Route Settings -> Static Routes -> Add...
- Route Name (Target): Any name
- Ams Net Id: Your IP address + 1.1 (for example, 192.168.0.10.1.1)
- Transport Type: TCP/IP
- Address Info: Your IP address
Click Add Route, then Close.
Current Routes can also be used, but your IP address is removed from the allowed list after the controller reboots.
After loading the PLC program into the controller, reflash it so the program and all settings are restored after reboot: PLC Control -> Online -> CreateBootproject.