Connecting a PLC to the Eziwan platform
Objective
This guide explains how to connect a programmable logic controller (PLC) or an RTU to the Eziwan platform to upload its data to the cloud and enable secure remote access. Three methods are covered, depending on the type of connection available on your controller:
- Method 1 — Modbus RTU via RS-485 (controllers with a serial port)
- Method 2 — Modbus TCP via Ethernet (controllers with an Ethernet port)
- Method 3 — OPC-UA (modern controllers with a built-in OPC-UA server)
By the end of this guide, your PLC will be connected to the Eziwan platform, its data will be visible on the dashboard, and you will be able to set up threshold alerts.
Prerequisites
Before you begin, make sure you have the following items:
- Eziwan Gateway properly installed, powered on, and connected to the Internet (green status LED).
- Access to the Eziwan dashboard with administrator privileges on the relevant site.
- PLC technical documentation: list of Modbus registers or OPC-UA nodes, slave address, serial parameters.
- PLC equipped with at least one of the following ports:
- RS-232 or RS-485 port — Method 1 (Modbus RTU)
- Ethernet port with Modbus TCP enabled — Method 2
- Ethernet port with OPC-UA server enabled — Method 3
- A shielded twisted-pair RS-485 cable (Method 1) or an RJ45 Cat5e/Cat6 cable (Methods 2 and 3).
- Supported protocols include: Modbus RTU, Modbus TCP, OPC-UA.
Siemens S7-1200 / 1500 / 300 / 400, Schneider Modicon M340 / M580 / Quantum, Allen-Bradley CompactLogix / ControlLogix, Mitsubishi MELSEC iQ-R, Beckhoff CX, and most PLCs and RTUs that support the above protocols.
Method 1 — Modbus RTU via RS-485
RS-485 Wiring
The RS-485 bus is a 2- or 3-wire differential connection. Be sure to observe the polarity strictly:
| Eziwan Gateway Terminal | Cable | PLC Terminal |
|---|---|---|
| A+ (DATA+) | Wire 1 (light color recommended) | A or D+ or + |
| B- (DATA-) | Wire 2 (dark color recommended) | B or D- or - |
| GND | Shield or ground wire | GND or COM (if available) |
Wiring Recommendations:
- Use shielded twisted-pair cable (e.g., Belden 9841 or equivalent) to reduce electromagnetic interference.
- Connect the shield to ground on the gateway side only to avoid ground loops.
- On a multi-slave RS-485 bus, install a 120 Ω terminating resistor at both ends of the cable.
- Maximum length: 1,200 m at 9,600 baud, 300 m at 115,200 baud.
The most common error in Modbus RTU is the reversal of the A+ and B- wires. If the read test returns a timeout, start by checking the wiring polarity before adjusting any software settings.
Configuration in the Eziwan interface
- Log in to the Eziwan dashboard (https://app.eziwan.com).
- Navigate to My Fleet → [Site Name] → Configuration → Data Sources.
- Click Add Source → Modbus RTU.
- Enter the following settings:
| Parameter | Value |
|---|---|
| Slave Address | Modbus address of the PLC (1–247) |
| Baud rate | Same as the PLC: 9,600 / 19,200 / 38,400 / 57,600 / 115,200 |
| Parity | None / Even / Odd (depending on PLC configuration) |
| Data bits | 8 (standard) |
| Stop bits | 1 or 2 (depending on PLC configuration) |
- Add the data points: For each register to be read, specify the function code (FC01–FC04), the register address, the data type (INT16, UINT16, INT32, FLOAT32, BOOL), and the physical unit.
- Set the acquisition interval (e.g., every 10 seconds).
- Click Save.
Reading Test (FC03)
Use the "Read Test" function in the Eziwan interface to send an FC03 request and verify the PLC's response before enabling cloud data transmission. A green result confirms that communication has been established. A timeout or a Modbus exception indicates a configuration or wiring issue.
Method 2 — Modbus TCP via Ethernet
Network Prerequisites
Before configuring:
- The Eziwan gateway and the PLC must be on the same IP subnet (e.g., 192.168.1.x/24), or a route must be configured between them.
- TCP port 502 (the standard Modbus TCP port) must not be blocked by a firewall or industrial switch between the two devices.
- Modbus TCP must be enabled in the PLC configuration (Siemens TIA Portal: Ethernet module → Modbus TCP server; Schneider Unity Pro: Communication section).
IP Configuration and Connectivity Test
- Note the IP address of the PLC (e.g., 192.168.1.10).
- From the Eziwan diagnostic terminal, run a ping to the PLC's IP address to verify network connectivity.
- Run a TCP test on the IP address and port 502 to confirm that the Modbus TCP service is responding.
Configuration in the Eziwan interface
- Go to My Fleet → [Site Name] → Configuration → Data Sources.
- Click Add Source → Modbus TCP.
- Enter the settings:
| Parameter | Value |
|---|---|
| IP Address | PLC IP address (e.g., 192.168.1.10) |
| TCP Port | 502 (standard Modbus TCP port) |
| Slave Address (Unit ID) | PLC address (usually 1 or 255) |
| Timeout | 1,000 ms (adjustable depending on network response time) |
- Add the data points (function code, register address, type, unit).
- Set the acquisition period.
- Click Save.
Ping Test and Read Test
From the Eziwan dashboard, run a ping followed by a Modbus TCP read test to verify the entire chain (network + protocol) before enabling cloud data transmission.
Method 3 — OPC-UA
OPC-UA (Open Platform Communications Unified Architecture) is the recommended protocol for modern PLCs that support it natively: Siemens S7-1500, Schneider Modicon M580, Beckhoff TwinCAT, and Allen-Bradley ControlLogix 5380. OPC-UA offers superior security (authentication, certificates, TLS encryption) and rich data semantics.
Configuring the OPC-UA Server on the PLC
According to the manufacturer, enable the OPC UA server in the configuration software:
- Siemens TIA Portal: Properties → OPC UA → Server → Activate OPC UA server. Configure the port (default 4840) and access rights to the nodes.
- Schneider Unity Pro / Control Expert: Communication → OPC UA Server → Enabled. Define the exposed nodes.
- Beckhoff TwinCAT: Integrated TF6100 OPC UA Server module; configuration via TwinCAT System Manager.
Make a note of the OPC-UA endpoint URL: opc.tcp://[IP-automate]:4840 (or the custom port).
Configuration in the Eziwan interface
- Go to My Fleet → [Site Name] → Configuration → Data Sources.
- Click Add Source → OPC-UA.
- Enter the settings:
| Parameter | Value |
|---|---|
| Server URL | opc.tcp://192.168.1.10:4840 |
| Security mode | None / Sign / Sign&Encrypt (depending on PLC configuration) |
| Authentication | Anonymous / Username+Password / Client Certificate |
| Namespace | PLC namespace index (e.g., 2 for Siemens) |
- Browse the OPC-UA node tree to select the variables to monitor.
- Set the acquisition interval (or "subscribe on value change" mode).
- Click Save.
Checking in the dashboard
Once the configuration has been saved, verify that the data is being reported correctly:
- Open the Eziwan Dashboard for the relevant site.
- The values read from the PLC should appear in the real-time data widgets with a recent timestamp (less than 2 × the acquisition period).
- Verify the consistency of the values by comparing them with the local display on the PLC’s HMI or control panel.
- Verify that no error icons are present on the data source (orange or red triangle).
Configuring Threshold Alerts
After the connection has been validated, set up alerts to be automatically notified in the event of an anomaly:
- Go to Alerts → Rules → Create a Rule.
- Select the variable to monitor (e.g., "Pump Outlet Pressure").
- Define the condition (e.g.,
> 6.5 baror< 0.5 bar). - Configure the notification channel: email, SMS, or webhook (Slack, Teams, PagerDuty).
- Set the on-call hours if necessary.
- Enable the rule.
Common Mistakes
| Symptom | Probable Cause | Solution |
|---|---|---|
| Modbus RTU timeout / no response | Incorrect slave address | Check the address configured on the PLC |
| Modbus RTU timeout | Mismatched baud rate | Match the serial settings on both ends |
| No Modbus RTU response | Reversed RS-485 A+/B- wiring | Swap the A and B wires at one end |
| Modbus TCP timeout | Port 502 blocked by firewall | Open port 502 on the firewall or industrial switch |
| Modbus exception 02 (Illegal Data Address) | Non-existent register address | Check the register list in the PLC documentation |
| Modbus Exception 03 (Illegal Data Value) | Incorrect data type or length | Check the function code and the number of registers requested |
| OPC-UA: Connection refused | Eziwan certificate not trusted | Trust the Eziwan certificate in the PLC’s trust store |
| OPC-UA: Authentication Failed | Incorrect credentials | Check the username and password in the PLC’s OPC-UA configuration |
Safety
Best practices to follow when connecting a PLC:
- Read-only by default: If your use case does not require remote control (writing to registers), configure read-only access in Eziwan to minimize the attack surface.
- VPN enabled: Make sure the OpenVPN/IPSec VPN tunnel is active on the gateway before exposing OT devices. Never leave a PLC accessible from the Internet without a VPN.
- Access auditing: Enable access logs in Eziwan to track all remote access to devices (who, when, what action).
- Network segmentation: Isolate the OT network (PLCs) from the IT network on-site. The Eziwan gateway is the only bridge between the two networks.
- Firmware updates: Keep the Eziwan gateway firmware up to date to benefit from the latest security patches.
Related Resources
- RS-485 and Modbus Guide
- VPN and Secure Access Guide
- Remote Access to a PLC
- Modbus Glossary
- PLC / API Glossary
Frequently Asked Questions
What protocols are supported for connecting a PLC?
Modbus RTU (RS-485), Modbus TCP, OPC-UA, and vendor-specific protocols via VPN passthrough. The gateway’s local pulse and analog inputs round out data collection for simple sensors.
How long does it take to connect a PLC?
With a Modbus TCP controller already on the network: less than 30 minutes (device registration, register mapping, verification). For RS-485, add the A/B wiring and bus termination.
Should the PLC program be modified?
Not for reading: The gateway queries the exposed variables (%MW, DB, and OPC-UA node words). Only when writing setpoints may it be necessary to reserve a dedicated exchange area in the program.
What should you check if the connection isn't working?
In order: physical layer (A/B wiring, 120 Ω termination on RS-485; TCP ping), serial parameters (baud rate, parity), slave address / Unit ID, and finally register addressing (offset 0 or 1 depending on the tools). The console displays frames and error codes in real time.
Related Resources
- Connecting a PLC to the Cloud — the multi-brand solution page
- Remote Access to Industrial PLCs — taking remote control
- RS485 / Modbus RTU — wiring and polling details
- Siemens S7 Compatibility — TIA Portal configuration
- Schneider M340 compatibility — EcoStruxure configuration