Repository navigation
fix(j2mod): do not declare serverFileRecord; FC20 two-sub-request self-test - #21
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
serverFileRecordis nowfalse. FC20 and FC21 stay inserverFunctions, because the library does answer them. The README has a "What it cannot do" row for this.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 hasserver:serverFileRecord,client:clientRaw,client:clientRawAnyResponse.serverFileRecordentry is now no, and the j2mod finding is updated.interop_version0.4.1.Wire evidence
Request PDU:
14 0e 06000100000002060002000000020c 0506000b01a4 0506000100020c 0506000b0506 000100020000Results
make documentswith all nine images:The new check passed 5 times. It was unsupported 76 times, for the pairings that lack the gate.
make validate lintpasses.Reproduction
make images && make documentsRelease
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