MC Protocol Ethernet driver for Mitsubishi FX3 PLCs
Project description
fx3u-mcprotocol — Python MC Protocol Library for Mitsubishi FX3 PLCs
fx3u-mcprotocol is an open-source Python MC Protocol library for communicating with Mitsubishi FX3 series PLCs over Ethernet.
It allows Python applications to read PLC memory
(D, M, X, Y, R devices) from Mitsubishi FX3 PLCs using
MC Protocol (ASCII mode) via Ethernet (TCP/IP).
The library is tested with FX3U + FX3U-ENET-ADP and is suitable for industrial automation, data acquisition, SCADA integration, and custom monitoring systems.
Why fx3u-mcprotocol?
If you are searching for:
- MC Protocol Python library
- Mitsubishi FX3 PLC Python communication
- FX3U Ethernet Python driver
- Read Mitsubishi PLC data using Python
this library is designed exactly for that use case.
Unlike generic PLC libraries, fx3u-mcprotocol focuses specifically on FX3 PLCs and provides a simple, symbol-based API aligned with real industrial workflows.
Features
- Python MC Protocol implementation for Mitsubishi FX3 PLCs
- Symbol-based addressing (
D100,M8000, etc.) - Read word devices (D, R, TN, TS, …)
- Read bit devices (M, X, Y)
- Multiple PLC connections in a single application
- CPU profile validation (FX3S / FX3G / FX3U / FX3GC)
- Modular architecture (transport, protocol, symbols, profiles)
- Pure Python (no external runtime dependencies)
Installation
Install the library directly from PyPI:
pip install fx3u-mcprotocol
✅ Stable ASCII MC Protocol support (FX3 series)
⚠️ Binary MC Protocol support is experimental and may vary by firmware
Example
from fx3u_mcprotocol import FX3UClient
plc = FX3UClient(
ip="192.168.4.4",
port=5001,
cpu="FX3U",
mode="ascii",
)
plc.connect()
# Read PLC registers (D devices)
print(plc.readReg("D100"))
print(plc.readRegs("D100", 3))
# Read PLC bits (M devices)
print(plc.readBit("M0"))
print(plc.readBits("M8000", 1)) # RUN bit
plc.close()
This example demonstrates how to read Mitsubishi FX3 PLC memory using Python over Ethernet with MC Protocol.
Supported Mitsubishi PLCs
- Mitsubishi FX3U
- Mitsubishi FX3G
- Mitsubishi FX3S
- Mitsubishi FX3GC
Note
- The library is tested on FX3U + FX3U-ENET-ADP. Other FX3 models are supported based on documented memory ranges.
Multiple PLC Example (Polling)
from fx3u_mcprotocol import FX3UClient
plcs = {
"PLC_1": "192.168.4.2",
"PLC_2": "192.168.4.3",
}
clients = {}
for name, ip in plcs.items():
plc = FX3UClient(ip=ip, cpu="FX3U", mode="ascii", read_only=True)
plc.connect()
clients[name] = plc
for name, plc in clients.items():
print(name, plc.readRegs("D100", 3))
This approach is commonly used for:
-
Data logging
-
Multi-machine monitoring
-
SCADA gateway development
Architecture Overview
The library is intentionally modular:
-
transport — TCP/IP socket communication
-
protocol — MC Protocol frame encoding/decoding
-
symbols — PLC symbol parsing (D100, M8000)
-
profiles — PLC CPU memory range validation
-
client — High-level user API
This design allows easy extension and future support for additional PLC families or protocols.
Legal Notice
-
This is an independent, open-source implementation based on publicly available protocol documentation.
-
This project is not affiliated with, endorsed by, or sponsored by Mitsubishi Electric.
License
- This project is licensed under the MIT License.
- See the LICENSE file for details.
Author
Piyush Ghumelia
Industrial Automation & Python Developer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fx3u_mcprotocol-1.0.0.tar.gz.
File metadata
- Download URL: fx3u_mcprotocol-1.0.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
96afa4f04558f7a2de017d1bbb0d307bfcd9ece4b149b968ef15cc7464f80870
|
|
| MD5 |
c2435f203253850d3dd31bccb5863b19
|
|
| BLAKE2b-256 |
5b9ed795125ea70e5e34a28d352cb5be8232e205af22f9faa04d90e8b0614bd5
|
File details
Details for the file fx3u_mcprotocol-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fx3u_mcprotocol-1.0.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18245bafca6644b128d250989bc9b14f8a845998db1440feef0b6ba5dbb97e97
|
|
| MD5 |
0a5996a753454e6db04fce13eaf94406
|
|
| BLAKE2b-256 |
70783c6d0f1acccd8d4da32fefff1f3486e1fe81a351681d3d761634df63c30b
|