Skip to content

About

一个Modbus串口调试助手,参考ModbusDebuger的PyQt6版本,支持跨平台。

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modbus Workbench PyQt6

Python/PyQt6 版本的跨平台 Modbus RTU 串口调试工具,串口日志观察和常用功能码构帧。

Modbus Workbench 主界面

界面说明

主界面按 Modbus 工作流分成三栏:

  • 左侧是连接和日志控制区,用于选择串口、设置波特率/数据位/校验位/停止位、配置接收分包间隔、过滤和保存日志。
  • 中间是帧轨道,按方向、时间、长度、HEX 和文本显示收发帧,便于比对请求和响应。
  • 右侧是发送和构帧区,支持 HEX/文本发送、自动追加 Modbus CRC16、定时发送,以及 03/04/06/10 常用 RTU 帧生成。

运行

Linux/macOS:

python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt
.venv/bin/python main.py

Windows PowerShell:

py -m venv .venv
.\.venv\Scripts\python -m pip install -r requirements.txt
.\.venv\Scripts\python main.py

当前功能

  • 串口枚举、刷新、打开和关闭
  • 波特率、数据位、校验位、停止位设置
  • 接收分包超时
  • HEX/文本发送
  • 自动追加 Modbus CRC16
  • 定时发送
  • 03/04/06/10 常用 RTU 帧构造
  • 收发帧轨道、搜索、方向过滤、选中帧摘要
  • 日志保存
  • JSON 配置自动保存

PyInstaller 打包

先在虚拟环境中安装 PyInstaller:

Linux/macOS:

.venv/bin/python -m pip install pyinstaller

Windows PowerShell:

.\.venv\Scripts\python -m pip install pyinstaller

打包为单文件可执行程序:

Linux/macOS:

.venv/bin/pyinstaller --noconfirm --clean --windowed --onefile \
  --name ModbusWorkbench main.py

Windows PowerShell:

.\.venv\Scripts\pyinstaller --noconfirm --clean --windowed --onefile `
  --name ModbusWorkbench main.py

打包产物位于 dist/ModbusWorkbench,Windows 下为 dist/ModbusWorkbench.exe。

如果目标机器缺少串口访问权限,Linux 通常需要把当前用户加入 dialout 或对应串口设备所属用户组,然后重新登录。

About

一个Modbus串口调试助手,参考ModbusDebuger的PyQt6版本,支持跨平台。

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages