Skip to content

Fix OPC UA DataValue StatusCode compatibility - #193

Open
genishernandez wants to merge 1 commit into
Autonomy-Logic:developmentfrom
genishernandez:fix/opcua-asyncua-datavalue-statuscode
Open

Fix OPC UA DataValue StatusCode compatibility#193
genishernandez wants to merge 1 commit into
Autonomy-Logic:developmentfrom
genishernandez:fix/opcua-asyncua-datavalue-statuscode

Conversation

@genishernandez

Copy link
Copy Markdown

Description

Fixes OPC UA DataValue construction compatibility between asyncua versions.

asyncua 1.x uses the StatusCode_ field, while newer versions use StatusCode. The synchronization layer now handles both APIs without changing the configured dependency version.

This fixes OPC UA read and subscription operations failing with:

TypeError: DataValue.init() got an unexpected keyword argument 'StatusCode_'

Changes

  • Added a compatibility helper for ua.DataValue.
  • Supports both StatusCode and StatusCode_.
  • Updated read callbacks and subscription push DataValue creation.

Target branch: development

@genishernandez

Copy link
Copy Markdown
Author

The issue was detected while testing the OPC UA functionality of OpenPLC Runtime in an Ubuntu Linux virtual machine.

During the test, OPC UA read and subscription operations failed with the following error:

TypeError: DataValue.__init__() got an unexpected keyword argument 'StatusCode_'

We reproduced the issue in the Ubuntu environment and traced it to the asyncua DataValue API. The installed asyncua version expects StatusCode, while the synchronization layer was constructing DataValue using StatusCode_.

This led us to implement a compatibility helper that supports both StatusCode and StatusCode_, allowing the OPC UA synchronization layer to work with both asyncua API variants without changing the project's configured dependency version.

The fix was then tested against the affected OPC UA read and subscription paths.

@genishernandez genishernandez reopened this Sep 6, 2026
@genishernandez
genishernandez changed the base branch from main to development September 6, 2026 17:48
@genishernandez genishernandez reopened this Sep 6, 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