Skip to content

fix(j2mod): do not declare serverFileRecord; FC20 two-sub-request self-test - #21

Merged
boeboe merged 2 commits into
mainfrom
fix/j2mod-file-record
Nov 9, 2026
Merged

boeboe merged 2 commits into
mainfrom
fix/j2mod-file-record

Conversation

@boeboe

@boeboe boeboe commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

j2mod 3.2.1 gets FC20 (Read File Record) wrong when a request has two sub-requests: it answers the second one with the wrong records. The Modbus Application Protocol V1.1b3, §6.14, and FIXTURES.md rule 10 require each sub-response to carry the records that were asked for. The j2mod adapter still declared serverFileRecord: true, and the existing self-tests did not catch it.

go-modbus's interop suite caught it against the v0.4.0 candidate images.

Changes

  • adapters/j2mod: serverFileRecord is now false. FC20 and FC21 stay in serverFunctions, because the library does answer them. The README has a "What it cannot do" row for this.
  • scripts/interop.sh: new check values.fc20.two-sub-requests. It sends a raw FC20 with two sub-requests (file 1 records 0–1 and file 2 records 0–1) and compares the answer byte for byte with the fixture. It runs when the pairing has server:serverFileRecord,client:clientRaw,client:clientRawAnyResponse.
  • docs/COMPATIBILITY.md: the j2mod serverFileRecord entry is now no, and the j2mod finding is updated.
  • versions.yaml and RELEASE.md: interop_version 0.4.1.

Wire evidence

Request PDU: 14 0e 0600010000000206000200000002

Server Response data Correct?
PyModbus 0c 0506000b01a4 050600010002 Yes
j2mod 3.2.1 0c 0506000b0506 000100020000 No: the second sub-response is not file 2's records

Results

make documents with all nine images:

Outcome Count
pass 9394
fail 0
unsupported 5114
infra-error 0

The new check passed 5 times. It was unsupported 76 times, for the pairings that lack the gate.

make validate lint passes.

Reproduction

make images && make documents

Release

After this merges, go-modbus pins v0.4.1 instead of v0.4.0, so that j2mod's FC20 does not need a consumer-side skip. That needs a v0.4.1 release.

🤖 Generated with Claude Code

boeboe and others added 2 commits November 9, 2026 00:40
j2mod answers the second sub-request of an FC20 request with the wrong
records (Modbus Application Protocol V1.1b3, 6.14; FIXTURES.md rule 10).
Add the values.fc20.two-sub-requests self-test, which catches it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@boeboe
boeboe merged commit 87e091e into main Nov 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant