This project provides a graphical user interface (GUI) for interacting with a Modbus RTU device using the Tkinter library in Python. The application allows users to connect to a Modbus device via a serial port, configure communication parameters, send data to holding registers, control a buzzer, and monitor the status of various keys and LEDs.
- Connect/Disconnect to Modbus Device: Connect or disconnect to a Modbus RTU device via a selected serial port and baud rate.
- Send Data to Holding Registers: Send up to three lines of text to the device's holding registers.
- Buzzer Control: Turn the buzzer on, off, or make it beep.
- LED Status Monitoring: Monitor the status of three LEDs which represent the state of UP, DOWN, and ENTER keys.
- ACK Keys: Acknowledge the pressing of UP, DOWN, and ENTER keys.
- Modbus Configuration: Change the Modbus device's communication parameters including baud rate and Modbus ID.
- Python 3.x
-
Clone the repository:
git clone https://github.com/aliyaghoobi88/Modbus-Display-Config-Python.git cd Modbus-Display-Config-Python
-
Install the required Python packages using
requirements.txt
:pip install -r requirements.txt
-
Run the application:
python modbus_gui.py
-
Connect to Modbus Device:
- Select the appropriate serial port and baud rate from the dropdown menus.
- Enter the Modbus ID.
- Click on the
Connect
button.
-
Send Data to Holding Registers:
- Enter text in the Line1, Line2, and Line3 fields (up to 11 characters each).
- Click the
Send to Holding Registers
button.
-
Control the Buzzer:
- Use the
Buzzer ON
,Buzzer OFF
, andBeep
buttons to control the buzzer.
- Use the
-
Monitor and Acknowledge Keys:
- The LED indicators will show the status of the UP, DOWN, and ENTER keys (green for pressed, red for not pressed).
- Click the
ACK
buttons to acknowledge key presses.
-
Change Modbus Configuration:
- Select a new baud rate and Modbus ID.
- Click the
Change Param
button to apply the new configuration.
- Top Section: Connect/Disconnect controls.
- Middle Section: Text input for Line1, Line2, Line3 and sending to holding registers.
- Lower Section: Buzzer controls, LED indicators, and ACK buttons.
- Bottom Section: Modbus configuration controls.
This project leverages the following libraries:
- Tkinter for the GUI.
- pyserial for serial communication.
- minimalmodbus for Modbus RTU communication.
Contributions are welcome! Please open an issue or submit a pull request with your improvements or bug fixes.