Skip to content

fix fails to write string longer than declared in controller#530

Merged
PTKu merged 6 commits into
devfrom
fix-fails-to-write-string-longer-than-declared-in-controller
Jun 12, 2026
Merged

fix fails to write string longer than declared in controller#530
PTKu merged 6 commits into
devfrom
fix-fails-to-write-string-longer-than-declared-in-controller

Conversation

@PTKu

@PTKu PTKu commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
  • test(connector): add failing tests for string write capacity normalization
  • fix(connector): truncate string writes to declared capacity
  • test(compiler): add failing golden fixture for declared string capacities
  • feat(compiler): emit declared string capacity into generated twins
  • test(connector): add live-PLC E2E tests for string capacity truncation

PTKu added 6 commits June 12, 2026 13:49
NormalizeString passed values <=254 chars through untouched and
truncated longer values to Capacity-1 with Capacity defaulting to 0,
which threw ArgumentOutOfRangeException. Cyclic write path skipped
normalization entirely. Shared helper now truncates to declared
capacity exactly (fallback 254 when capacity unknown) on SetAsync,
cyclic and peek paths, and logs a warning on truncation.
ixc discarded STRING[n]/WSTRING[n] capacity, so runtime twins never
knew the declared size (Capacity stayed 0). Constructor builders now
emit `.Capacity = n;` after every string factory call (254 when
undeclared), including configuration globals and arrays of strings.
Adds STRING[10]/WSTRING[10] vars to ax-test-project and verifies
boundary writes (9/10/11 chars) over SetAsync and cyclic paths plus
the 300-char write to a default STRING against real hardware. Drops
the manual Capacity workaround in the primitive test base since
generated twins now carry declared capacity.
@PTKu PTKu merged commit 773c6ad into dev Jun 12, 2026
2 checks passed
@PTKu PTKu deleted the fix-fails-to-write-string-longer-than-declared-in-controller branch June 12, 2026 12:39
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