Modbus debug

From LeoKemp223/embed-ai-tool · View interactive version

Modbus debug is an AI agent skill from the GitHub repository LeoKemp223/embed-ai-tool. 当需要调试 Modbus RTU(串口)或 Modbus TCP(网络)设备通信时使用,支持寄存器读写、从站扫描和持续监控。

How to use this skill

Skill file

Modbus 调试

适用场景

必要输入

依赖

执行步骤

  1. 先阅读 references/usage.md,确认操作参数。
  2. 探测环境:

```bash

python scripts/modbus_tool.py --detect

```

  1. 根据需求执行对应操作:

```bash

# 读保持寄存器

python scripts/modbus_tool.py --port COM42 --slave 1 --read --address 0 --count 10

# 写寄存器

python scripts/modbus_tool.py --port COM42 --slave 1 --write --address 0 --values 100,200

# 扫描从站

python scripts/modbus_tool.py --port COM42 --scan --scan-range 1-10

# TCP 读取

python scripts/modbus_tool.py --tcp --host 192.168.1.100 --slave 1 --read --address 0 --count 10

```

失败分流

输出约定

示例输出格式:

结果: ✅ 读取 10 个寄存器
  连接: RTU COM42 9600 8N1
  从站: 1

    地址 |  十进制 |  十六进制 |             二进制
  ------+---------+----------+--------------------
       0 |     100 | 0x0064   | 0000000001100100
       1 |     200 | 0x00c8   | 0000000011001000

交接关系

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.