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.
Compatibility with Tested PLCs

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 TerminalCablePLC Terminal
A+ (DATA+)Wire 1 (light color recommended)A or D+ or +
B- (DATA-)Wire 2 (dark color recommended)B or D- or -
GNDShield or ground wireGND 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.
A+/B- Wiring Reversed

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

  1. Log in to the Eziwan dashboard (https://app.eziwan.com).
  2. Navigate to My Fleet → [Site Name] → Configuration → Data Sources.
  3. Click Add Source → Modbus RTU.
  4. Enter the following settings:
ParameterValue
Slave AddressModbus address of the PLC (1–247)
Baud rateSame as the PLC: 9,600 / 19,200 / 38,400 / 57,600 / 115,200
ParityNone / Even / Odd (depending on PLC configuration)
Data bits8 (standard)
Stop bits1 or 2 (depending on PLC configuration)
  1. 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.
  2. Set the acquisition interval (e.g., every 10 seconds).
  3. 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

  1. Note the IP address of the PLC (e.g., 192.168.1.10).
  2. From the Eziwan diagnostic terminal, run a ping to the PLC's IP address to verify network connectivity.
  3. 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

  1. Go to My Fleet → [Site Name] → Configuration → Data Sources.
  2. Click Add Source → Modbus TCP.
  3. Enter the settings:
ParameterValue
IP AddressPLC IP address (e.g., 192.168.1.10)
TCP Port502 (standard Modbus TCP port)
Slave Address (Unit ID)PLC address (usually 1 or 255)
Timeout1,000 ms (adjustable depending on network response time)
  1. Add the data points (function code, register address, type, unit).
  2. Set the acquisition period.
  3. 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

  1. Go to My Fleet → [Site Name] → Configuration → Data Sources.
  2. Click Add Source → OPC-UA.
  3. Enter the settings:
ParameterValue
Server URLopc.tcp://192.168.1.10:4840
Security modeNone / Sign / Sign&Encrypt (depending on PLC configuration)
AuthenticationAnonymous / Username+Password / Client Certificate
NamespacePLC namespace index (e.g., 2 for Siemens)
  1. Browse the OPC-UA node tree to select the variables to monitor.
  2. Set the acquisition interval (or "subscribe on value change" mode).
  3. Click Save.

Checking in the dashboard

Once the configuration has been saved, verify that the data is being reported correctly:

  1. Open the Eziwan Dashboard for the relevant site.
  2. The values read from the PLC should appear in the real-time data widgets with a recent timestamp (less than 2 × the acquisition period).
  3. Verify the consistency of the values by comparing them with the local display on the PLC’s HMI or control panel.
  4. 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:

  1. Go to Alerts → Rules → Create a Rule.
  2. Select the variable to monitor (e.g., "Pump Outlet Pressure").
  3. Define the condition (e.g., > 6.5 bar or < 0.5 bar).
  4. Configure the notification channel: email, SMS, or webhook (Slack, Teams, PagerDuty).
  5. Set the on-call hours if necessary.
  6. Enable the rule.

Common Mistakes

SymptomProbable CauseSolution
Modbus RTU timeout / no responseIncorrect slave addressCheck the address configured on the PLC
Modbus RTU timeoutMismatched baud rateMatch the serial settings on both ends
No Modbus RTU responseReversed RS-485 A+/B- wiringSwap the A and B wires at one end
Modbus TCP timeoutPort 502 blocked by firewallOpen port 502 on the firewall or industrial switch
Modbus exception 02 (Illegal Data Address)Non-existent register addressCheck the register list in the PLC documentation
Modbus Exception 03 (Illegal Data Value)Incorrect data type or lengthCheck the function code and the number of registers requested
OPC-UA: Connection refusedEziwan certificate not trustedTrust the Eziwan certificate in the PLC’s trust store
OPC-UA: Authentication FailedIncorrect credentialsCheck 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.

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.