Skip to content

Conversation

@AskicV
Copy link

@AskicV AskicV commented Apr 28, 2025

…using write_to_list_by_name function.
The problem was the line ADST_INT8: PLCTYPE_BYTE, in the file: pyads.constants.py.
Because of this, the following exception was generated when writing negative values to the SINT variable or an Array of SINT: "ubyte format requires 0 <= number <= 255".
The correct way is to use: ADST_INT8: PLCTYPE_SINT, because PLCTYPE_SIN is actually c_byte from ctypes library and not c_ubyte. PLCTYPE_BYTE is c_ubyte and that generated the exception.

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