Parse Frame
parse_frameParse a raw protocol frame hex into structured fields with byte offsets and evidence. Supports Modbus, FINS, MELSEC, S7; auto-detects direction and explains malformed frames for diagnostics.
Instructions
把一帧报文 hex 逐字段结构化解析 (不需要连接设备)。
每个字段带 byte_offset 与 raw_hex 证据; 支持正常请求/响应与异常 响应帧; 畸形帧不抛错, 而是尽量解析并在 errors 里说明哪里坏 —— "解析失败的方式"本身是诊断证据。 direction: "auto" 按帧结构判别, 也可显式传 "req" / "resp"。 frame_format (仅 melsec): "3e_binary" / "3e_ascii" / "4e_binary" / "4e_ascii"。
modbus: 异常帧/非 12 字节按响应, 12 字节按请求 (fc05/06 的响应 与请求逐字节相同, 任一解释一致)
fins: TCP 命令 0x00 按请求 / 0x01、0x02 按响应; 0x04 按 FINS ICF bit6 判别 (响应置位)
melsec: 副头部 50 00/54 00 按请求, D0 00/D4 00 按响应 (ASCII 帧 "5000"/"5400"/"D000"/"D400" 同理)
s7: rosctr=0x01 (Job) 按请求, 0x03 (Ack_Data) 按响应; 显式传 direction 时按传入值
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| protocol | Yes | ||
| direction | No | auto | |
| frame_hex | Yes | ||
| frame_format | No | 3e_binary |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| valid | No | ||
| errors | No | ||
| fields | No | ||
| protocol | Yes | ||
| direction | Yes |