How to Connect a Schneider Electric M340 or M221 PLC to the IoT Cloud
Your Schneider Electric Modicon M340, M221, or M580 PLCs have been running for years, but monitoring remains local—on-site operator panel, no remote access, no historical trends. This guide shows you how to connect them to the IoT cloud without modifying your PLC program or interrupting production.
- Why connect your M340/M221 to the cloud?
- Modbus Compatibility of Schneider Electric PLCs
- Connection Architecture
- Configuring the Eziwan Gateway for Schneider
- What You Get in the Cloud
- Case Study: M340 Pumping Station
- Migration from SoMachine / Unity Pro
- EcoStruxure Compatibility
- Cloud Connection Comparison: M221 vs. M340 vs. M580
- FAQ — Connecting the M340/M221 to the Cloud
- Getting Started with Your POC
- Further Reading
- Additional Resources
Why connect your M340/M221 to the cloud?
Schneider Electric's Modicon series PLCs are used in thousands of industrial facilities in France: water treatment, pumping stations, food processing, and packaging lines. Robust and reliable, they often have a service life of 15–20 years.
But their native communication capabilities are limited:
- No native cloud connectivity
- Remote access often restricted to a costly MPLS VPN
- No long-term data logging without an on-premises SCADA server
- Alerts are either nonexistent or only local (indicator lights, horns)
The solution: an industrial IoT gateway that reads the Modbus data from your M340/M221 and sends it to the cloud, without modifying the PLC program.
Modbus Compatibility of Schneider Electric PLCs
Modicon M221
The M221 (TM221CE16R, TM221CE24T, etc.) features a native Modbus RTU port on its RJ45 connector (RS-485 via a TM3TI4 adapter or a specific cable) and a Modbus TCP port on its Ethernet port.
Accessible registers:
%MW0to%MW255— memory words%QW— analog outputs%IW— analog inputs%M— memory bits (coils 0–255)
Modbus Slave Configuration on the M221:
In EcoStruxure Machine Expert - Basic:
Configuration → Modbus SerialorModbus TCP- Slave address: 1 (default)
- Enable "Slave function" → OK
Modicon M340
The M340 (BMX P34 2020, BMX P34 2030, etc.) features a Modbus RTU serial port (RS-485, 9-pin SUB-D connector) and an ETH module (BMX NOE 0100 or BMX NOC 0401) for Modbus TCP.
Registers accessible via Modbus:
| PLC Zone | Modbus Type | Read Function | Range |
|---|---|---|---|
%MW | Holding Registers | FC03 | 400001–465535 |
%IW | Input Registers | FC04 | 300001–365535 |
%M | Coils | FC01 | 000001–065536 |
%I | Discrete Inputs | FC02 | 100001–165536 |
Modbus Address → Unity Pro Address:
- Register 400001 =
%MW0 - Register 400100 =
%MW99 - Register 400501 =
%MW500
Modicon M580 (ePAC)
The M580 features native Modbus TCP on its CPU Ethernet port and supports the same register tables as the M340, plus:
- Access to I/O modules via BMENOC0311 (Ethernet module)
- EtherNet/IP support
- Data Exchange capability with EcoStruxure Plant
Connection Architecture
Option 1: Via Modbus TCP (Ethernet) — recommended
Prerequisites:
- ETH module installed on the rack (BMX NOE 0100 for M340)
- PLC IP address configured (e.g., 192.168.1.10)
- Internal firewall allowing port 502 from the gateway's IP address
Advantages:
- No additional RS-485 wiring
- Higher throughput (up to 30 requests per second)
- Compatibility with Traffic Unity Pro (non-intrusive readings)
Option 2: Via Modbus RTU (RS-485)
For the M221: Use the TCSMCNAM3M002P cable (RJ45 to RS-485) or the VW3A8306 adapter, depending on the model.
For the M340: 9-pin SUB-D connector on the PLC side; pins 3 (+) and 8 (-) for RS-485.
M221/M340 Serial Settings (Default):
- Speed: 19,200 bps
- Parity: none (8N1)
- Slave address: 1
Configuring the Eziwan Gateway for Schneider
Once the gateway is connected, you can configure it from the Eziwan cloud interface with just a few clicks.
Add a Modbus Device
- Access
Flotte → Site → + Équipement - Select Modbus TCP or Modbus RTU
- Enter:
- IP:
192.168.1.10(or your M340’s address) - Port:
502 - Slave ID:
1
- IP:
Configure the variables to be read
| Variable | Modbus Register | Type | Description |
|---|---|---|---|
| Tank Level | %MW10 → 400011 | Holding (FC03) | 0-100% |
| Pump Flow | %MW20 → 400021 | Holding (FC03) | 0–500 m³/h |
| Pressure | %IW0 → 300001 | Input (FC04) | 0–16 bar |
| General fault | %M0 → 000001 | Coil (FC01) | Boolean |
| Pump on | %M1 → 000002 | Coil (FC01) | Boolean |
Conversion engineering: Apply a multiplier if the PLC returns a raw value (e.g., ×0.01 to convert from 1500 to 15.00 bar).
Recommended polling interval
| Criticality | Polling | Use Case |
|---|---|---|
| Real-time | 1 s | Safety, critical processes |
| Monitoring | 5 s | Production, energy |
| Trends | 30 s | Meter readings, statistics |
| Archive | 5 min | Simple remote meter reading |
What You Get in the Cloud
Real-Time Dashboard
As soon as the gateway connects for the first time, data is transmitted in real time to the Eziwan dashboard:
- Trend graphs for 1 hour, 24 hours, 7 days, and 30 days
- Configurable gauges and indicators
- Multi-site tables to compare your installations
- CSV/Excel export for reporting
Alert System
Set up specific alerts for each variable:
Alert: Tank Level
Condition : %MW10 < 10 (niveau bas)
Canal : SMS + Email
Recipients: equipe@maintenance.fr, astreinte@maintenance.fr
Acquittement : requis
Alert: Pump Failure
Condition: %M5 = 1 (fault bit active)
Channel: Instant SMS
Priority: Critical
Long-Term Historical Analysis
All data is archived for 5 years as standard, at no additional cost. You can:
- View production history for years N-1 and N-2
- Identify gradual deterioration (e.g., a pump drawing more current)
- Generate compliance reports (water, energy, pharmaceuticals)
Case Study: M340 Pumping Station
Background: A local government agency manages 12 pumping stations equipped with 2020 M340 BMX P34 units. Current maintenance: 3 field rounds per week, 2 technicians.
Deployed Configuration:
- 12 × Eziwan Gateway (Modbus TCP, SFR Business SIM)
- Variables read per station: well level, flow rate, discharge pressure, motor current, operating hours, faults (12 variables)
- Polling interval: 5 seconds for flow rate/pressure/failures, 1 minute for level/meters
Results after 6 months:
- On-site inspections: 3/week → 1/week (-67%)
- Incidents detected before a shutdown: 4 (overheated pump, stuck valve, seized float)
- Estimated savings: €41,000/year (travel costs + avoided corrective maintenance)
- ROI on equipment + subscription: 5 months
Migration from SoMachine / Unity Pro
If you are using SoMachine (M221) or Unity Pro (M340/M580), no changes to the PLC program are necessary. The Eziwan gateway connects in read-only mode by default.
If you also want to write commands (setpoints, commands) from the cloud:
- Use Function Codes FC05 (Write Single Coil) and FC06 (Write Single Register)
- Configure access rights in the Eziwan gateway (multi-factor authentication)
- Create register ranges specifically dedicated to remote commands (e.g.,
%MW200-MW220)
Writing to a PLC from the cloud must be subject to a risk analysis (HAZOP). Critical addresses (emergency stop, safety instructions) must be protected with read-only access.
EcoStruxure Compatibility
The Eziwan gateway is compatible with EcoStruxure in several ways:
Alongside EcoStruxure Plant
The gateway reads the same registers as your EcoStruxure SCADA system, without any interference. Ideal for adding:
- Centralized multi-site monitoring
- Mobile access for field technicians
- SMS/email alerts (often missing in the base EcoStruxure system)
Phased Replacement
If your EcoStruxure Plant license is nearing the end of its lifecycle, you can migrate in phases:
- Deploy the Eziwan gateway in parallel
- Validate the data for 4–8 weeks
- Switch the primary monitoring to Eziwan
- Reduce the EcoStruxure license to the scope that is actually needed
Cloud Connection Comparison: M221 vs. M340 vs. M580
| M221 | M340 | M580 | |
|---|---|---|---|
| Native Modbus RTU | ✅ (via cable) | ✅ (SUB-D 9) | ✅ |
| Native Modbus TCP | ✅ (ETH port) | ✅ (BMX NOE module) | ✅ native |
| Max Eziwan variables | 128 | 512 | 1024 |
| Min. polling interval | 1 s | 1 s | 500 ms |
| Register write | ✅ FC06 | ✅ FC06/FC16 | ✅ FC06/FC16 |
| Store-and-forward compatibility | ✅ | ✅ | ✅ |
FAQ — Connecting the M340/M221 to the Cloud
Do I need to modify the SoMachine/Unity Pro program? No. The Eziwan gateway connects as a Modbus master to the slave PLC. No code is added to the PLC. If the PLC is already configured as a Modbus slave (which is the default setting), the connection is established immediately.
My M340 already has a Unity Pro SCADA system—is it compatible? Yes. Multiple Modbus TCP masters can query the same slave simultaneously. The Eziwan gateway and your SCADA system can coexist without conflict, provided you configure a reasonable polling frequency (≥ 1 s).
Can I monitor analog input modules (BMX AMI 0410)?
Yes. The analog modules are addressed in the %IW (inputs) and %QW (outputs) tables. Refer to the Unity Pro documentation for the register mapping of your specific modules.
Does the gateway work if the 4G network is down? Yes. The Eziwan gateway includes an SD card buffer: data continues to be collected locally and is transmitted in batches once connectivity is restored (store-and-forward). Local alerts (direct SMS) remain operational without the cloud.
Is it compatible with the Zelio Logic product line? The Zelio Logic Smart Relay supports a limited version of Modbus RTU. Depending on the model (SR2/SR3), access to internal registers may be restricted. Please contact us to confirm compatibility with your specific model.
Getting Started with Your POC
Do you have an M340, M221, or M580 on-site and want to verify the cloud connection?
Eziwan offers a free 30-day POC that includes:
- 1 pre-configured gateway shipped within 48 hours
- Onboarding guided by our technical team
- Dashboards configured according to your specifications
- No commitment, no credit card required
Start the free POC → | Calculate your ROI →
Further Reading
- Blog: Connecting a Siemens S7 PLC to the Cloud — Technical Guide
- Blog: Secure Remote Access to PLCs and SCADA Systems — VPN and NIS2
- Blog: Modbus TCP vs. RTU — Which Protocol Should You Choose?
- Docs: Siemens S7-1200/S7-1500 compatibility
- Blog: IIoT predictive maintenance — from sensor data to alerts
Do you use other Schneider Electric product lines (Altivar, Easergy, PowerLogic)? Contact us to verify compatibility with your specific equipment.
Additional Resources
- Schneider PLC Remote Access — secure remote access to Schneider M340, M221, and M580 PLCs
- Connect a PLC to the cloud — connect any industrial PLC to the cloud
- Modbus TCP to the cloud — monitoring via Modbus TCP from the cloud
- Industrial Remote Access — VPN and zero-trust architecture for industrial sites
- Industrial Monitoring and Remote Support — centralized monitoring of your Schneider PLCs