Skip to content

Let read_tags and read_multi_vars read more than 20 items - #989

Merged
gijzelaerr merged 1 commit into
masterfrom
fix/read-tags-above-20
Nov 11, 2026
Merged

gijzelaerr merged 1 commit into
masterfrom
fix/read-tags-above-20

Conversation

@gijzelaerr

Copy link
Copy Markdown
Owner

read_multi_vars raised ValueError above MAX_VARS (20) before the optimizer ran, although the optimizer already splits requests across PDUs. The packetizer now also respects a 20-items-per-PDU limit, and read_tags refuses symbolic tags the way read_tag does. MAX_VARS stays a public name.

Commits

  • Let read_tags and read_multi_vars read more than 20 items

Testing

  • Test suite and mypy pass locally.
  • pre-commit passes except end-of-file-fixer on .dockerignore, which is a symlink artefact on Windows.
  • Not tested on hardware.

🤖 Generated with Claude Code

read_multi_vars raised ValueError when given more than MAX_VARS (20)
items, before the read optimizer ran, so read_tags failed above 20 tags
although the optimizer already spreads a read over several requests.

- The dict form of read_multi_vars and read_tags accept any number of
  items, in both clients. The ctypes form of read_multi_vars and
  write_multi_vars keep the MAX_VARS limit.
- optimizer.packetize takes a max_items argument (default 20) and starts
  a new packet when the current one holds that many blocks, next to the
  request and reply byte budgets. With a PDU of 480 bytes or more, over
  20 small blocks used to fit the byte budgets of one request. The
  client passes MAX_VARS.
- read_tags raises NotImplementedError for a symbolic tag, as read_tag
  does, in both clients.

MAX_VARS stays a public name with the value 20.
@gijzelaerr
gijzelaerr force-pushed the fix/read-tags-above-20 branch from 888c8b1 to bd67b17 Compare November 11, 2026 13:33
@gijzelaerr
gijzelaerr enabled auto-merge (squash) November 11, 2026 13:33
@gijzelaerr
gijzelaerr merged commit 18ea610 into master Nov 11, 2026
20 checks passed
@gijzelaerr
gijzelaerr deleted the fix/read-tags-above-20 branch November 11, 2026 13:37
@gijzelaerr gijzelaerr mentioned this pull request Nov 11, 2026
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