Python Modbus Data Logger (GUI Source Code)
π οΈ UPGRADE: This is the definitive Modbus RTU Logger package.
We built this tool to solve the biggest headache in automation: GUI freezing during high-frequency serial polling, and the complexity of testing non-standard devices.
The value of this package is not just the code, but the time saved on integration and configuration
β¨ New in V2.0: Professional Features
-
β‘ Standalone EXE Included: No Python installation required! Just download and double-click the
.exefile to run the logger instantly. -
βοΈ Fully Configurable Serial Port: You can now manually adjust all critical serial parameters directly in the GUI:
- Baud Rate (9600 - 115200)
- Data Bits (5-8)
- Parity (None, Even, Odd)
- Stop Bits (1, 1.5, 2)
- π‘οΈ Multi-threaded Stability: The logging loop is separated from the UI thread, ensuring the application never freezes, even during long, high-frequency data runs.
π Key Capabilities
- Modbus RTU Standard: Supports the required hex command structure, including automatic CRC-16 checksum appending.
- Raw Hex Logging: Logs the raw hex response alongside parsed data to a timestamped CSV file for deep analysis.
- Plug-and-Play: Works with any standard USB-to-RS485 adapter connected to a physical COM port.
- Source Code Access: Clean, well-structured Python source for easy integration into larger SCADA or monitoring projects.
β‘ Save 10+ Hours of Coding: The Ultimate Serial Debugging Tool.
Are you tired of writing the same boilerplate code for every new hardware project?
Building a reliable Serial/Modbus tool with a GUI is harder than it looks. You have to handle UI freezing (non-responsive windows), complex Hex string parsing, and CRC-16 checksum calculations.
I have built a production-ready, multi-threaded Python application so you don't have to start from scratch.
π What Makes This Code Special?
- π§΅ Non-Blocking Multi-threading: The serial reading loop runs in a separate background thread. This ensures your UI never freezes, even when polling devices at high speeds.
- β Auto-Calculate Modbus CRC-16: Forget about manual checksum calculators. The script automatically appends the correct CRC (Little-Endian) to your Hex commands.
- πΎ Instant CSV Logging: Data is automatically saved to
soiling_data.csvwith precise timestamps, making it perfect for long-term stability testing.- π οΈ Native GUI (Tkinter): Built using Python's standard
tkinterlibrary. No heavy installations (like Qt) required. It just works.- π Plug & Play: Automatically detects available COM ports and handles connection errors gracefully.
π¨βπ» Perfect For:
- Automation Engineers: Quickly test PLCs, Inverters, or Sensors via RS485.
- Python Learners: A perfect example of how to combine
tkinterwiththreadingandpyserial.- Hardware Testers: Log sensor data over 24 hours without writing a single line of code.
π What's Inside the ZIP?
main.py: The complete, fully commented source code.requirements.txt: Simple dependency file.README.md: Step-by-step setup guide.π‘ Fully Customizable: Since you get the full source code, you can easily modify the parsing logic to fit any proprietary protocol.
Stop debugging your tools. Start debugging your hardware.
A complete, multi-threaded Serial/Modbus logging tool built with Python Tkinter. Save hours of coding time.