Skip to content

fix: parse SZL 0x0011 records properly for S7-1500 - #789

Open
gijzelaerr wants to merge 1 commit into
masterfrom
fix-783-order-code-szl-parsing
Open

fix: parse SZL 0x0011 records properly for S7-1500#789
gijzelaerr wants to merge 1 commit into
masterfrom
fix-783-order-code-szl-parsing

Conversation

@gijzelaerr

Copy link
Copy Markdown
Owner

Summary

  • Fixes get_order_code() returning empty/corrupted data on S7-1500 CPUs (regression in pure Python 3.x)
  • parse_order_code_szl now properly parses the SZL partial-list header (LengthDR + NDR) and iterates through records to find the first non-empty MLFB
  • Server's SZL 0x0011 response updated to use the standard record format with proper header

Closes #783

Test plan

  • All 1600 existing tests pass
  • Pre-commit hooks pass (mypy, ruff, ruff format)
  • Verified manually with simulated S7-1500 multi-record response (empty first record + MLFB in second record)
  • Needs real hardware verification on S7-1500 by reporter

🤖 Generated with Claude Code

Real S7-1500 PLCs include a partial-list header (LengthDR + NDR) and
per-record index fields in SZL 0x0011 responses. The previous code
used hardcoded offsets that only worked when the MLFB started at byte 0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

Bug Report: get_order_code() returns corrupted or empty data on S7-1500 (regression in pure Python implementation 3.x)

1 participant