A powerful Qt-based Modbus testing application with visual modeling capabilities for protocol development, testing, and monitoring.
- Multi-Protocol Support: Both Modbus TCP and Modbus RTU
- Visual Register Modeling: Create, edit, and manage Modbus registers with an intuitive UI
- Real-time Monitoring: Continuous polling of register values
- Trigger System: Event-based actions when register conditions are met
- Project Management: Save and load complete protocol configurations
-
Support for all Modbus register types:
- Coils (FC01/FC05/FC15)
- Discrete Inputs (FC02)
- Holding Registers (FC03/FC06/FC16)
- Input Registers (FC04)
-
Multiple data types:
- Bool (1 bit)
- UInt16 / Int16 (16-bit integers)
- UInt32 / Int32 (32-bit integers)
- Float32 (IEEE 754 floating point)
-
Read-only and read-write register support
-
Individual register polling intervals
-
Batch read operations
-
TCP Configuration:
- IP address and port
- Configurable timeout and retries
-
RTU Configuration:
- Serial port selection
- Baud rate (9600-115200)
- Data bits, stop bits, parity
-
Connection status monitoring
-
Automatic reconnection handling
- Condition-based event monitoring
- Supported conditions: ==, !=, >, <, >=, <=
- Custom action descriptions
- Real-time trigger evaluation during polling
sudo apt-get update
sudo apt-get install qt5-default qtbase5-dev qttools5-dev-tools
sudo apt-get install libqt5serialbus5-dev libqt5serialport5-devsudo dnf install qt5-qtbase-devel qt5-qttools-devel
sudo dnf install qt5-qtserialbus-devel qt5-qtserialport-develbrew install qt@5
export PATH="/usr/local/opt/qt@5/bin:$PATH"Download and install Qt from https://www.qt.io/download Make sure to include:
- Qt 5.12+ (or Qt 6.x)
- Qt SerialBus module
- Qt SerialPort module
cd QModbusUniversal-master
qmake QModbusUniversal.pro
makemkdir build
cd build
cmake ..
make./QModbusUniversalQModbusUniversal.exe- File → New Project to start fresh
- Configure connection settings:
- Choose TCP or RTU
- Enter connection parameters
- Set slave ID (default: 1)
- Click Add Register button
- Configure register properties:
- Name (identifier)
- Register Type (Coil, Holding Register, etc.)
- Address (0-65535)
- Data Type (Bool, UInt16, Int32, etc.)
- Description (optional)
- Read Only checkbox
- Poll Interval (0 = manual only)
- Read All: Read all configured registers once
- Read Selected: Read currently selected register
- Write Selected: Write to selected register (if not read-only)
- Double-click value cell to quickly write new value
- Set poll interval (milliseconds)
- Click Start in Polling section
- Only registers with poll interval > 0 will be polled
- Click Stop to halt polling
- Switch to Triggers tab
- Click Add Trigger
- Configure:
- Select register to monitor
- Choose condition (==, !=, >, <, >=, <=)
- Enter threshold value
- Describe action (logged when triggered)
- Triggers are evaluated during polling
- File → Save Project (Ctrl+S)
- File → Save Project As... (Ctrl+Shift+S)
- Projects saved as .mbproj JSON files
- Contains all registers, triggers, and settings
QModbusUniversal/
├── main.cpp # Application entry point
├── mainwindow.h/.cpp/.ui # Main window and UI logic
├── modbusregister.h/.cpp # Register data model
├── modbusproject.h/.cpp # Project container with serialization
├── registerdialog.h/.cpp/.ui # Register configuration dialog
├── triggerdialog.h/.cpp/.ui # Trigger configuration dialog
├── QModbusUniversal.pro # Qt project file
├── CMakeLists.txt # CMake build configuration
└── README.md # This file
- Bool: 1 register (0 or 1)
- UInt16/Int16: 1 register
- UInt32/Int32/Float32: 2 registers (big-endian)
All multi-register values use big-endian byte order:
- First register contains most significant 16 bits
- Second register contains least significant 16 bits
This tool is particularly useful for:
- Protocol fuzzing and edge case testing
- Penetration testing of Modbus implementations
- Validating device behavior under various conditions
- Simulating client interactions
- Create protocol model (registers)
- Connect to device/simulator
- Test read/write operations
- Set up triggers for monitoring
- Enable polling for continuous monitoring
- Save project for later use
- TCP: Verify host IP and port are correct
- RTU: Check serial port permissions (
sudo chmod 666 /dev/ttyUSB0) - Verify slave ID matches device configuration
- Increase timeout if device is slow to respond
- Ensure Qt SerialBus module is installed
- Check Qt version (minimum Qt 5.12)
- On Linux, you may need to install libqt5serialbus5-dev package
- Check log tab for error messages
- Verify register addresses match device configuration
- Ensure data types match register contents
- For RTU, verify serial parameters match device
This project is provided as-is for educational and testing purposes.
Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.