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

ADI model from Embedded example import fails #509

Closed
mpostol opened this issue Feb 7, 2021 · 8 comments
Closed

ADI model from Embedded example import fails #509

mpostol opened this issue Feb 7, 2021 · 8 comments
Assignees
Labels
Bug Bug in the code.

Comments

@mpostol
Copy link
Owner

mpostol commented Feb 7, 2021

ADI model from Embedded example import fails because DI namespace is selected and ) nodes are selected.

@mpostol mpostol self-assigned this Feb 7, 2021
@mpostol mpostol transferred this issue from mpostol/ASMD Feb 7, 2021
@mpostol mpostol added the Bug Bug in the code. label Feb 7, 2021
@mpostol mpostol added this to the UAModelDesignExport_6.2.1 milestone Feb 7, 2021
mpostol added a commit that referenced this issue Feb 7, 2021
- changed version information
- added anchor for further development - the problem is selection of the correct namespace
mpostol added a commit that referenced this issue Feb 7, 2021
- added model SemanticData/Tests/USNodeSetValidationUnitTestProject/XMLModels/ProblemsToReport/ADI#509/Opc.Ua.Adi.NodeSet2.xml for testing
mpostol added a commit that referenced this issue Feb 7, 2021
- added model in concern SemanticData/Tests/USNodeSetValidationUnitTestProject/XMLModels/ProblemsToReport/eoursel510/Opc.Ua.NodeSet2.TriCycleType_V1.1.xml
@mpostol
Copy link
Owner Author

mpostol commented Feb 7, 2021

Further development will be conducted on the branch https://github.com/mpostol/OPC-UA-OOI/tree/SemanticData-6.1.3

mpostol added a commit that referenced this issue Feb 7, 2021
- Preparation before testing - refactoring UnitTest unimportant changes
- UT 👍
@mpostol
Copy link
Owner Author

mpostol commented Feb 8, 2021

Tasks

  • possibility to open ModelDesign file by ASMD
  • possibility to import NodeSet file
  • possibility to convert NodeSet to ModelDesign
  • possibility to open generated ModelDesign file by ASMD
  • possibility to compile ModelDesign and generate NodeSet file (round trip test)
  • validation against the schema and compliance with the specification (Part 3 and Part 5) of the NodeSet file
  • correct generation of the model documentation in MS Word format
  • correct generation of website content with the model documentation

@mpostol
Copy link
Owner Author

mpostol commented Feb 8, 2021

possibility to import NodeSet file

  • appropriate namespace must be selected - now DI is validated
  • validation ADI causes some unexpected problems (must be investigated)

mpostol added a commit that referenced this issue Feb 8, 2021
- added test to investigate the problem.
@mpostol
Copy link
Owner Author

mpostol commented Feb 8, 2021

validation ADI causes some unexpected problems (must be investigated)

Exception while comparing BrowseName. An exception is thrown by the different syntax of the BrowseName

  • 1:TransitionNumber vs TransitionNumber
  • 1:StateNumber vs StateNumber

UANodeSet schema:

From http://opcfoundation.org/UA/2011/03/UANodeSet.xsd

  <xs:complexType name="UANode">
    ...
    <xs:attribute name="BrowseName" type="QualifiedName" use="required"></xs:attribute>
    ....
  </xs:complexType>

  <xs:simpleType name="QualifiedName">
    <xs:restriction base="xs:string"></xs:restriction>
  </xs:simpleType>

OPC Part 3

QualifiedName

This Built-in DataType contains a qualified name. It is, for example, used as BrowseName. Its elements are defined in Table 25. The name part of the QualifiedName is restricted to 512 characters.

Name Type Description
namespaceIndex UInt16 Index that identifies the namespace that defines the name. This index is the index of that namespace in the local Server’s NamespaceArray.The Client may read the NamespaceArray Variable to access the string value of the namespace.
name String The text portion of the QualifiedName.

OPC Part 6

Annex F (normative) Information Model XML Schema

The XML Schema released with this version of the standards can be found here:

http://www.opcfoundation.org/UA/schemas/1.04/UANodeSet.xsd

NOTE The latest file that is compatible with this version of the standards can be found here:

http://opcfoundation.org/UA/2011/03/UANodeSet.xsd

F.3 UANode

Element Type Description
BrowseName QualifiedName A QualifiedName serialized as a String with the form: <namespace index>:<name>Where the NamespaceIndex refers to the NamespaceUris table.

mpostol added a commit that referenced this issue Feb 8, 2021
- added anchor to follow up the problem: validation ADI causes some unexpected problems (must be investigated)
mpostol added a commit that referenced this issue Feb 8, 2021
-improved unit test for Qualified
@mpostol
Copy link
Owner Author

mpostol commented Feb 9, 2021

5.3.1.14 QualifiedName

There is another interesting OPC UA specyfication entry point sugested by @jouniaro. It describes the syntax of the Qualified name encoded as the XML element on the wire to transfer it between the OPC UA applications:

A QualifiedName value is encoded as an xs:complexType with the following XML schema:

  <xs:complexType name="QualifiedName">
    <xs:sequence>
      <xs:element name="NamespaceIndex" type="xs:int" minOccurs="0" />
      <xs:element name="Name" type="xs:string" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>

Note

  • <minOccurs> - The <minOccurs> indicator specifies the minimum number of times an element can occur. It mens that the following snipped is valid against the schema:
  <QualifiedName>
  </QualifiedName>

mpostol added a commit that referenced this issue Feb 14, 2021
- Added ref InterchangeXML to the REFERENCES.md
- unimportant changes
mpostol added a commit that referenced this issue Feb 14, 2021
ADI model from Embedded example import fails #509
@mpostol
Copy link
Owner Author

mpostol commented Feb 14, 2021

Some more snippets from the OPC UA Address Space Interchange XML related to BrowseName:

The BrowseName of a Property is always unique in the context of a node. Any node is not permitted to refer to two Variables using references of the HasProperty type having the same BrowseName.

If the DataVariable is used as instance declaration all nodes referenced with hierarchical references in the forward direction shall have unique BrowseNames in the context of this DataVariable.

`MethodDeclarationId
This attribute may be specified for a Method node that is a target of a HasComponent reference from a single Object node. It is the NodeId of the UAMethod with the same BrowseName contained in the TypeDefinition associated with the Object node. If the TypeDefinition overrides a Method inherited from a base ObjectType, this attribute shall reference the Method node in the subtype.
A unique name for the data type encoded using the syntax described in the section QualifiedName. This field is only specified for nested DataTypeDefinitions. The BrowseName of the DataType node is used otherwise
UAReferenceType

The inherited BrowseName attribute is used to specify the meaning of the ReferenceType as seen from the source node. For example, the ReferenceType with the BrowseName “Contains” is used in References which specify that the source node contains the target node. The inherited DisplayName attribute contains a translation of the BrowseName.

The BrowseName of a ReferenceType shall be unique in a server. It is not allowed that two different ReferenceTypes have the same BrowseName.
BrowseName
Nodes have a BrowseName attribute that is used as a non-localized human-readable name when browsing the Address Space to create paths out of BrowseNames. The TranslateBrowsePathsToNodeIds service can be used to follow a path constructed of BrowseNames.
A BrowseName should never be used to display the name of a node. The DisplayName should be used instead for this purpose.
Unlike NodeId, the BrowseName cannot be used to unambiguously identify a node. Different nodes may have the same BrowseName.
The section BrowseName defines the structure of the BrowseName. It contains a namespace and a string. The namespace is provided to make the BrowseName unique in some cases in the context of a Node (e.g. Properties of a Node) although not unique in the context of a server Address Space. If different organizations define BrowseNames for Properties, the namespace of the BrowseName provided by the organization makes the BrowseName unique, although different organizations may use the same string having a slightly different meaning.
Servers may often choose to use the same namespace for the NodeId and the BrowseName. However, if they want to provide a standard Property, its BrowseName shall have the namespace of the standard body although the namespace of the NodeId reflects something else, for example, the local server.
It is recommended that standard bodies defining standard type use their namespace for the NodeId of the TypeDefinitionNode as well as for the BrowseName of the TypeDefinitionNode.
The string-part of the BrowseName is case sensitive. That is, Clients shall consider it case sensitive. Servers are allowed to handle BrowseNames passed in service requests as case insensitive. Examples are the TranslateBrowsePathsToNodeIds service or Event filter.
SymbolicName
A symbolic name for the node that can be used as a class/field name by design tools to enhance auto-generated code. It should only be specified if the BrowseName cannot be used for this purpose. This field is not used directly to instantiate Address Space and is intended for use by design tools. Only letters, digits, or the underscore (‘_’) are permitted. This attribute is not exposed in the Address Space.

mpostol added a commit that referenced this issue Feb 14, 2021
ValidateAndExportModel

Test Name:	ADITest
Test Outcome:	Passed
Result StandardOutput:
Debug Trace:
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering IAddressSpaceContext.ValidateAndExportModel - starting for the http://opcfoundation.org/UA/ADI/ namespace.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information AddressSpaceContext.ValidateAndExportModel - selected 41 nodes to be added to the model.
Trace: Information, Error Focus:NodeClass, ErrorID: P3-0502020001 Info: NodeId is not defined. References to node with NodeId: ns=2;i=12386 is omitted during the import.
Trace: Information, Error Focus:NodeClass, ErrorID: P3-0502020001 Info: NodeId is not defined. References to node with NodeId: ns=2;i=12386 is omitted during the import.
Trace: Information, Error Focus:NodeClass, ErrorID: P3-0502020001 Info: NodeId is not defined. References to node with NodeId: ns=2;i=12386 is omitted during the import.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Finishing Validator.ValidateExportModel - the model contains 41 nodes.
mpostol added a commit that referenced this issue Feb 14, 2021
@mpostol
Copy link
Owner Author

mpostol commented Feb 14, 2021

The current result of ValidateAndExportModel with default exporter

Test Name:	ADITest
Test Outcome:	Passed
Result StandardOutput:	
Debug Trace:
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Entering IAddressSpaceContext.ValidateAndExportModel - starting for the http://opcfoundation.org/UA/ADI/ namespace.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information AddressSpaceContext.ValidateAndExportModel - selected 41 nodes to be added to the model.
Trace: Information, Error Focus:NodeClass, ErrorID: P3-0502020001 Info: NodeId is not defined. References to node with NodeId: ns=2;i=12386 is omitted during the import.
Trace: Information, Error Focus:NodeClass, ErrorID: P3-0502020001 Info: NodeId is not defined. References to node with NodeId: ns=2;i=12386 is omitted during the import.
Trace: Information, Error Focus:NodeClass, ErrorID: P3-0502020001 Info: NodeId is not defined. References to node with NodeId: ns=2;i=12386 is omitted during the import.
Trace: Verbose, Error Focus:Diagnostic, ErrorID: P0-0003010000 Info: It is diagnostic information Finishing Validator.ValidateExportModel - the model contains 41 nodes.

@mpostol
Copy link
Owner Author

mpostol commented Feb 23, 2021

Decision

@mpostol mpostol closed this as completed Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug in the code.
Projects
None yet
Development

No branches or pull requests

1 participant