Skip to content

Repository files navigation

Modbus-Tools Logo

Modbus-Tools

Modbus debugging and analysis desktop tool built with Qt and C++.

English | 简体中文 | 繁體中文

Overview

Modbus-Tools focuses on day-to-day debugging work rather than protocol marketing. It currently provides:

  • Modbus TCP Client for active Modbus TCP requests
  • Modbus RTU Master for serial Modbus requests
  • Frame Analyzer for parsing raw Modbus TCP / RTU frames
  • IEEE 754 Converter standalone utility for Float32/Float64 and 4-byte/8-byte endianness matrix calculations
  • Link to Analyzer for pushing live Modbus responses into the analyzer
  • Generic TCP Client / TCP Server / UDP tooling
  • A separate Serial Debugger page

The project is intended for debugging, validation, and lab or field troubleshooting. It is not a safety-certified product.

Core Capabilities

  • Visual request building for common Modbus read/write workflows
  • Raw frame sending helpers, including CRC16 append for RTU and MBAP encapsulation for TCP
  • Polling workflows with response/error tracking
  • Frame Analyzer:
    • Offline / Paste & Parse and real-time live linkage from Modbus sessions with pause/resume support
    • Protocol auto-detection and frame breakdown (Header, Function Code, Exception, Data payload, Checksum)
    • Multi-type decoded data grid supporting UInt16, Int16, Float32, Int32, UInt32, and Float64
    • Stride-aware batch register type assignment, row multi-selection, and Delete shortcut to reset custom types
    • Endianness / Byte Order switching (ABCD, CDAB, BADC, DCBA)
    • Configurable scaling factor, register description editing, and import/export via JSON config and CSV
    • Parsing history tracking with quick recall and collapsible sidebar
  • IEEE 754 Converter:
    • Standalone bidirectional converter for Float32/Float64, Hex, Signed/Unsigned Int, and byte order matrices
    • Real-time synchronization, edge case detection (NaN, Infinity, Denormalized), and quick preset values
  • Three UI languages with seamless runtime switching: English, Simplified Chinese, and Traditional Chinese

Platform Scope

  • Source builds are supported on Windows, Linux, and macOS
  • Release packaging is driven by CMake target release_bundle
  • The built-in updater / auto-update path is Windows-only at the moment
  • On non-Windows platforms, the main application still builds, but the updater target is disabled by design

Build

Download

  • Windows users can download prebuilt packages from Releases

Build From Source

Single-config generators, such as Ninja:

git clone --recursive https://github.com/mingyucheng692/Modbus-Tools.git
cd Modbus-Tools
cmake -S . -B build -DMODBUS_TOOLS_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build --target Modbus-Tools --parallel

Multi-config generators, such as Visual Studio 17 2022:

git clone --recursive https://github.com/mingyucheng692/Modbus-Tools.git
cd Modbus-Tools
cmake -S . -B build -G "Visual Studio 17 2022" -DMODBUS_TOOLS_BUILD_TESTS=ON
cmake --build build --target Modbus-Tools --config Release --parallel

Release Bundle

Single-config generators, such as Ninja:

cmake -S . -B build_release -DMODBUS_TOOLS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release
cmake --build build_release --target release_bundle --parallel

Multi-config generators, such as Visual Studio 17 2022:

cmake -S . -B build_release -G "Visual Studio 17 2022" -DMODBUS_TOOLS_BUILD_TESTS=OFF
cmake --build build_release --target release_bundle --config Release --parallel

Notes

  • Toolchain: C++20, Qt 6, CMake 3.25+
  • Optional build switches include MODBUS_TOOLS_ENABLE_ASAN, MODBUS_TOOLS_ENABLE_UBSAN, MODBUS_TOOLS_ENABLE_CLANG_TIDY, and MODBUS_TOOLS_ENABLE_VERBOSE_RUNTIME_LOGS
  • Linux CI installs additional Qt/XCB dependencies before building

Quality

Automated checks are part of normal development, but they are engineering safeguards, not a certification claim.

  • Unit and integration tests are organized into focused targets such as test_core_logic, test_qt_core, test_ui_widgets, test_integration, and test_modbus_fuzz
  • CI runs a cross-platform matrix on Windows, Linux, and macOS
  • Linux CI also includes non-blocking clang-tidy
  • The deterministic fuzz target is built and executed on Linux when ASan test runs are enabled

Run Tests Locally

cmake -S . -B build -DMODBUS_TOOLS_BUILD_TESTS=ON
cmake --build build --parallel
ctest --test-dir build --output-on-failure

For multi-config generators such as Visual Studio, add --config Debug or --config Release to the build command and -C Debug or -C Release to ctest.

Repository Layout

core/   protocol, session, transport, parser, update logic
infra/  IO, logging, platform helpers
ui/     widgets, pages, presentation logic, i18n
tests/  unit, integration, focused regression targets
app/    desktop application entry point

Boundaries

  • Modbus protocol support is limited to master workflows: Modbus TCP master (client) and Modbus RTU master
  • Generic network tooling is separate from Modbus roles and supports TCP client, TCP server, and UDP
  • Auto-update is currently available only on Windows
  • To debug multiple links simultaneously, launch additional application instances — one session per process
  • This repository prioritizes runtime correctness, stability, and debuggability over feature breadth
  • The software is provided under the MIT license and remains intended for development and troubleshooting use

Contributing

Issues and pull requests are welcome.

If you contribute code, use git commit -s so each commit includes a DCO sign-off:

Signed-off-by: Your Name <your.email@example.com>

Notes

  • Usage, warranty, and liability boundaries are documented in DISCLAIMER.md
  • Acknowledgments: thanks to Qt, spdlog, fmt, and GoogleTest

License

Licensed under the MIT License.

About

Cross-platform Modbus debugging tool built with Qt 6 and modern C++20 — TCP client, RTU/ASCII serial master, raw frame analyzer, TCP/UDP utilities, polling with traffic monitoring. Portable, no-install deployment.

Topics

Resources

Stars

11 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages