PyModbus GUI is a Python-based graphical user interface (GUI) for communicating with Modbus devices (RTU/TCP). It allows users to read/write Modbus registers, visualize real-time data, and interact with Modbus-compatible industrial devices effortlessly.
✅ Connect to Modbus RTU & TCP Devices
✅ Read/Write Holding & Input Registers
✅ Real-Time Data Monitoring
✅ User-Friendly GUI (Tkinter)
✅ Error Handling & Connection Diagnostics
Before running the application, make sure you have Python 3.7+ installed. You can check your Python version using:
python --version
git clone https://github.com./your-username/pymodbus-gui.git
cd pymodbus-gui
Run the following command to install the required packages:
pip install -r requirements.txt
To start the PyModbus GUI, execute:
python main.py
-
Modbus RTU (Serial Port)
- COM Port (e.g.,
COM3
or/dev/ttyUSB0
) - Baud Rate (9600, 19200, etc.)
- Parity, Stop Bits, and Timeout
- COM Port (e.g.,
-
Modbus TCP (Ethernet/Internet)
- IP Address (e.g.,
192.168.1.100
) - Port (Default:
502
)
- IP Address (e.g.,
- Select Modbus Type: RTU (Serial) or TCP (Ethernet)
- Enter Connection Parameters (COM Port/IP Address, Baud Rate, etc.)
- Click "Connect"
- Select Function Code (e.g.,
Read Coil Registers (FC3)
) - Enter Slave ID, Register Address, and Number of Registers
- Click "Read" to fetch data
- Select Function Code (e.g.,
Write Single Register (FC6)
) - Enter Slave ID, Register Address, and Value
- Click "Write" to send data
pymodbus-gui/
│── gui/ # GUI-related files
│── modbus/ # Modbus communication scripts
│── main.py # Main script to run the app
│── config.py # Configuration settings
│── utils.py # Utility functions (e.g., logging, error handling)
│── README.md # Project documentation
│── requirements.txt # Python dependencies
│── .gitignore # Files to ignore in Git
Ensure you have all necessary dependencies installed:
pymodbus
tkinter
pyserial
Install them with:
pip install -r requirements.txt
- Check if the Modbus device is powered on
- Verify the COM port / IP Address & Port
- Ensure Baud Rate, Parity, and Stop Bits match
- For Modbus RTU: Ensure the correct USB-to-RS485 converter is used
- For Modbus TCP: Make sure the firewall is not blocking port 502
- Run:
pip install pymodbus pyserial
📌 Graphical Data Plotting (Live Charts for Modbus Data)
📌 CSV Export of Modbus Readings
📌 Modbus Coil Status Control
📌 Multi-Slave Support
This project is licensed under the MIT License – feel free to modify and improve it!
Contributions are welcome! Follow these steps to contribute:
- Fork the Repository
- Create a Feature Branch
git checkout -b feature-branch
- Make Changes & Commit
git add . git commit -m "Added new feature"
- Push & Create a Pull Request
git push origin feature-branch
- Open a Pull Request (PR) on GitHub