How to Connect a Schneider Electric M340 or M221 PLC to the IoT Cloud

· 9 min read
9 min read
Eziwan Team
IoT Infrastructure

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?

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:

  • %MW0 to %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:

  1. Configuration → Modbus Serial or Modbus TCP
  2. Slave address: 1 (default)
  3. 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 ZoneModbus TypeRead FunctionRange
%MWHolding RegistersFC03400001–465535
%IWInput RegistersFC04300001–365535
%MCoilsFC01000001–065536
%IDiscrete InputsFC02100001–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

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

  1. Access Flotte → Site → + Équipement
  2. Select Modbus TCP or Modbus RTU
  3. Enter:
    • IP: 192.168.1.10 (or your M340’s address)
    • Port: 502
    • Slave ID: 1

Configure the variables to be read

VariableModbus RegisterTypeDescription
Tank Level%MW10 → 400011Holding (FC03)0-100%
Pump Flow%MW20 → 400021Holding (FC03)0–500 m³/h
Pressure%IW0 → 300001Input (FC04)0–16 bar
General fault%M0 → 000001Coil (FC01)Boolean
Pump on%M1 → 000002Coil (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).

CriticalityPollingUse Case
Real-time1 sSafety, critical processes
Monitoring5 sProduction, energy
Trends30 sMeter readings, statistics
Archive5 minSimple 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)
Safety Precautions for Remote Commands

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:

  1. Deploy the Eziwan gateway in parallel
  2. Validate the data for 4–8 weeks
  3. Switch the primary monitoring to Eziwan
  4. Reduce the EcoStruxure license to the scope that is actually needed

Cloud Connection Comparison: M221 vs. M340 vs. M580

M221M340M580
Native Modbus RTU✅ (via cable)✅ (SUB-D 9)
Native Modbus TCP✅ (ETH port)✅ (BMX NOE module)✅ native
Max Eziwan variables1285121024
Min. polling interval1 s1 s500 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


Do you use other Schneider Electric product lines (Altivar, Easergy, PowerLogic)? Contact us to verify compatibility with your specific equipment.


Additional Resources