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

DataTypes created in Profile Designer are missing required Encoding #119

Open
jwise-mfg opened this issue Aug 7, 2024 · 9 comments
Open
Assignees
Labels
bug Something isn't working P0 Top Priority

Comments

@jwise-mfg
Copy link
Member

jwise-mfg commented Aug 7, 2024

When a user creates or extends a DataType in Profile Designer, the exported Nodeset is missing the required DataType Encoding element, causing import to fail in other tools:

  • Prosys Forge
  • Prosys Codegen
  • Siemens Siome

The error is shown in the screenshot below from Siome, but is the result of a defect in Profile Designer. Per OPC UA Part 3, DataType definitions MUST be accompanied by DataTypeEncoding definitions: https://reference.opcfoundation.org/Core/Part3/v105/docs/5.8.4

image

@jwise-mfg jwise-mfg changed the title DataType's created in Profile Designer are missing required Encoding DataTypes created in Profile Designer are missing required Encoding Aug 7, 2024
@jwise-mfg
Copy link
Member Author

@jwise-mfg
Copy link
Member Author

Part of the solution is includes an Object for the DefaultBinary encoding. I copied and pasted this from the above example to the end of the offending extension Nodeset.

<UAObject NodeId="ns=1;i=5003" BrowseName="Default Binary" SymbolicName="DefaultBinary">
    <DisplayName>Default Binary</DisplayName>
    <References>
      <Reference ReferenceType="HasTypeDefinition">i=76</Reference>
      <Reference ReferenceType="HasEncoding" IsForward="false">ns=1;i=3012</Reference>
      <Reference ReferenceType="HasDescription">ns=1;i=6021</Reference>
    </References>
  </UAObject>

Another part of the solution is to include a reference to this Object in the References section of the extended Type definition

<References>
    <Reference ReferenceType="HasEncoding">ns=1;i=5003</Reference>
</References>

This gets past the Encoding error, but throws another error -- likely because I don't have the full inheritance path of the UAObject node above.

@cesmii cesmii deleted a comment from PaulLinYao Aug 8, 2024
@jwise-mfg
Copy link
Member Author

jwise-mfg commented Aug 8, 2024

This "BEFORE" Nodeset is exactly as exported from the Profile Designer, and exhibits the above error in Siome:
jonathanwise.net.profiles.material.BEFORE.nodeset2.xml.txt

This "AFTER" Nodeset is with the partial solution from the previous post, and throws a different (but less severe) error in Siome.
jonathanwise.net.profiles.material.AFTER.nodeset2.xml.txt

@PaulLinYao
Copy link
Collaborator

PaulLinYao commented Aug 8, 2024 via email

@jwise-mfg
Copy link
Member Author

jwise-mfg commented Aug 13, 2024

I don't see how that HasEncoding references the Default Binary encoding type. Can you modify the "BEFORE" nodeset to fix it?

@jwise-mfg
Copy link
Member Author

This "AFTER" Nodeset almost works, because:

  • It adds an Alias for OutputInformationDatatype from UA (Line 17)
  • It includes an Object definition for Default Binary (Line 35)
  • It references that definition as the Encoding for the Material Extension (Line 26)

However, we still have a problem passing validation because a node relationship is still missing.

I think this is because the Default Binary definition (copy and pasted from opcfoundation.org.ua.machiner.jobs.nodeset2.xml) has a reference relationship of HasTypeDefinition with i=76 -- but I don't know where that comes from.

jonathanwise.net.profiles.material.AFTER2.nodeset2.xml.txt

@jwise-mfg
Copy link
Member Author

Guidance from Randy Armstrong from the OPC Foundation:

In this case the requirement is very simple: when a new DataType is added to the model the tool should automatically create 2 DataType encoding Nodes with the BrowseName “Default Binary” and “Default XML”.

The NodeClass is Object, the TypeDefinition is DataTypeEncodingType (i=76) and there is a HasEncoding reference from the DataType to the encoding nodes.

@jwise-mfg
Copy link
Member Author

OK, the attached shows how to fix it properly. This MUST be added to the Profile Designer to make it compliant.

  • The UADataType definition, starting at line 18 includes two Reference children of the References node, pointing to an encoding at i=5003 and i=5004 (those are numbers that I made up, autogenerated Ids would work too)
  • The bottom of the document contains the two UAObject definitions of those Encodings, lines 35 and 42, that each have a reverse relationship back to the UADataType

Each new DataType will have its own pair of default encoding UAObjects (since each reverse relationship is unique)

jonathanwise.net.profiles.material.AFTER3.nodeset2.xml.txt

Please fix in Profile Designer ASAP.

@jwise-mfg
Copy link
Member Author

jwise-mfg commented Aug 16, 2024

User reports we might also need an Alias (in the Aliases section):

<Alias Alias="HasEncoding">i=38</Alias>

I don't know how to validate that, but other (official) Nodesets include this Alias, so it seems required -- see attached.
jonathanwise.net.profiles.material.AFTER3.nodeset4.xml.txt

@oliviamorales oliviamorales added the bug Something isn't working label Jan 28, 2025
@jwise-mfg jwise-mfg added the P0 Top Priority label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P0 Top Priority
Projects
None yet
Development

No branches or pull requests

4 participants