Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExtensionObjects with String TypeIds #1739

Open
julius-frenzel opened this issue Oct 29, 2024 · 0 comments
Open

ExtensionObjects with String TypeIds #1739

julius-frenzel opened this issue Oct 29, 2024 · 0 comments

Comments

@julius-frenzel
Copy link

julius-frenzel commented Oct 29, 2024

Description

I'm working with a nodeset generated by CODESYS for a PLC, which has been causing several issues. While most seem to stem from the CODESYS side, one issue appears to be an unnecessary limitation in the Asyncua library itself. Specifically, the nodeset generated uses string-based identifiers for ExtensionObjects, as shown in the abbreviated XML example below. When exporting the nodeset to XML, the check for integer identifiers in xmlexporter.py/_value_to_etree() raises an UaInvalidParameterError:

  <UAVariable/>
    <DisplayName/>
    <Description/>
    <References/>
    <Value>
      <uax:ExtensionObject>
        <uax:TypeId>
          <uax:Identifier>ns=3;s=|type|My_String_Identifier</uax:Identifier>
        </uax:TypeId>
        <uax:Body/>
      </uax:ExtensionObject>
    </Value>
  </UAVariable>

From UA Part 6: Mappings (V. 1.05.03) / section 5.2.2.15:

"Server implementers should use namespace-qualified numeric NodeIds for any DataTypeEncoding Objects they define. This will minimize the overhead introduced by packing Structured DataType values into an ExtensionObject."

My understanding of this part of the standard is that it recommends—but does not strictly require—the use of numeric NodeIds for ExtensionObjects. The standard only mandates numeric identifiers explicitly for ExtensionObjects in the UA namespace (section 5.2.2.15). Currently, my nodeset exports correctly if I disable the numeric identifier check.

To Reproduce

Unfortunately I can't provide the complete nodeset, but any ExtensionObject with a String TypeId should trigger the behavior.

Expected behavior

Allow String IDs for types of Extension objects.

Screenshots

image
UAExpert doesn't have any problems with String IDs for types of ExtensionObjects

Versions

Python-Version: 3.12.3

opcua-asyncio Version: 1.1.5 (installed via Anaconda)

@julius-frenzel julius-frenzel changed the title ExtensionObjects with String IDs ExtensionObjects with String TypeIds Oct 29, 2024
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

No branches or pull requests

1 participant