Exception thrown when loading Model

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
Christian
Sr. Member
Sr. Member
Posts: 10
Joined: 07 Feb 2013, 16:48

Exception thrown when loading Model

Post by Christian »

Hello,

I encountered a problem when loading the model for the nodemanager. The model and the according .xml file have been compiled by UaModeler.

The following code line ...

Code: Select all

ImportUaNodeset(Assembly.GetEntryAssembly(), "mymodel.xml");
... throws an exception with the following text.
Failed to start MyNodeManager Encountered end element: 'http://opcfoundation.org/UA/2008/02/Typ ... spaceIndex' when expecting element: 'http://opcfoundation.org/UA/2008/02/Types.xsd:DataType'.

I can't figure out where I made a mistake. Comparing my genereated mymodel.xml to the tutorial "buildingautomation.xml" didn't help.

Thanks for your help.

Best regards,
Christian

- Working with UA Bundle SDK .NET 2.2.0.255 and UaModeler 1.2.1 -

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Exception thrown when loading Model

Post by Support Team »

Hello Christian,

This is a known bug in the XmlExporter of the UaModeler. The bug will be fixed in UaModeler 1.3.
The problem occurrs if you used custom data types for method arguments. You can fix the XML file manually. Change the DataType tag of the Argument tags from (e. g.)

Code: Select all

<uax:DataType>
    <uax:Identifier>i=3001</uax:Identifier>
    <uax:NamespaceIndex>1</uax:NamespaceIndex>
</uax:DataType>
to

Code: Select all

<uax:DataType>
    <uax:Identifier>ns=1;i=3001</uax:Identifier>
</uax:DataType>
Note: The manual changes are overwritten if you export the addessspace again.

Best regards,
Unified Automation Support Team

Christian
Sr. Member
Sr. Member
Posts: 10
Joined: 07 Feb 2013, 16:48

Re: Exception thrown when loading Model

Post by Christian »

Thanks a lot for your fast reply. Now it works.

Best regards
Christian

Post Reply