Skip to content

Fix: map ADST_INT8 to PLCTYPE_SINT instead of PLCTYPE_BYTE#519

Merged
stlehmann merged 1 commit into
stlehmann:masterfrom
AskicV:feature/fix_ADST_INT8_data_type
May 19, 2026
Merged

Fix: map ADST_INT8 to PLCTYPE_SINT instead of PLCTYPE_BYTE#519
stlehmann merged 1 commit into
stlehmann:masterfrom
AskicV:feature/fix_ADST_INT8_data_type

Conversation

@AskicV
Copy link
Copy Markdown
Contributor

@AskicV AskicV commented May 14, 2026

Problem

ADST_INT8 represents TwinCAT SINT, a signed 8-bit integer (-128 to 127).
It was incorrectly mapped to PLCTYPE_BYTE (c_ubyte, unsigned 0-255),
causing an exception when writing values to variables of this data type.

Root cause

In src/pyads/constants.py:
ADST_INT8: PLCTYPE_BYTE ← c_ubyte is unsigned (0-255)

Fix

ADST_INT8: PLCTYPE_SINT ← c_int8 is signed (-128 to 127)

@stlehmann stlehmann merged commit 75304c0 into stlehmann:master May 19, 2026
7 checks passed
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25850838429

Coverage remained the same at 93.407%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 11466
Covered Lines: 10710
Line Coverage: 93.41%
Coverage Strength: 0.93 hits per line

💛 - Coveralls

@stlehmann
Copy link
Copy Markdown
Owner

@AskicV thanks for this....merged it.

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.

3 participants