Skip to content

fix: match real engineering-tool SZL read and continuation request layouts - #942

Merged
gijzelaerr merged 1 commit into
masterfrom
fix-szl-request-layout
Oct 7, 2026
Merged

gijzelaerr merged 1 commit into
masterfrom
fix-szl-request-layout

Conversation

@gijzelaerr

Copy link
Copy Markdown
Owner

Fixes #937.

Replaying captures of real S7-300 controllers showed two byte-level differences from what an engineering tool sends:

  • build_read_szl_request used the data header 0a 00 (a request without data) in front of the SZL id and index. Real tools, and native Snap7 for requests that carry data, send return code 0xFF with octet-string transport size 0x09.
  • build_userdata_followup_request used an 8-byte parameter block with method 0x11. Real continuation requests use 12 bytes with method 0x12 (00 01 12 08 12 <type|group> <subfn> <seq> 00 00 00 00).

Both are changed; the follow-up builder is shared, so block-info and list-blocks continuations get the same form. The bundled server did not depend on the old bytes. Tests pin the real SZL read request for SZL 0x0132, index 4 (ignoring the PDU reference) and the new follow-up layout.

I could not confirm whether a PLC rejects the old requests; this aligns the packets with what the captures show a real tool sending.

@gijzelaerr
gijzelaerr force-pushed the fix-szl-request-layout branch from f104c83 to 87b03db Compare October 7, 2026 10:16
@gijzelaerr
gijzelaerr merged commit 4550e93 into master Oct 7, 2026
20 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.

SZL read and follow-up requests differ from a real engineering tool (data header 0x0a/0x00 instead of 0xff/0x09; 8-byte vs 12-byte parameters)

1 participant