How to Use Model Compiler when only Nodeset2.xml is available as a dependency?|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
How to Use Model Compiler when only Nodeset2.xml is available as a dependency?
Avatar
FarNA
Member
Members
Forum Posts: 4
Member Since:
05/12/2023
sp_UserOfflineSmall Offline
1
06/02/2023 - 14:16
sp_Permalink sp_Print

Hello,

I have a demo AppModel.xml which depends on Safety UA-NodeSet. I see the only files available in the safety nodes set link are pre generated Opc.Ua.Safety.NodeSet2.xml , Opc.Ua.Safety.NodeIds.csv and Opc.Ua.Safety.Types.xsd.

I want to understand how to use UA-Model compiler to compile and generate AppModel.Nodeset2.xml with the above dependency as the model compiler only takes xml as an argument. I am using the latest UA-Model compiler

 

Opc.Ua.ModelCompiler.exe compile -d2 AppModel.xml -d2 ("What to Put here") -cg AppModel.csv -o2 .\output_files

 

This is my AppModel.xml

<ModelDesign
xmlns:uax="https://opcfoundation.org/UA/2008/02/Types.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:opcua="https://opcfoundation.org/UA/"
xmlns:safety="https://opcfoundation.org/UA/Safety/"
xmlns:Demo="urn:open62541.server.application"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
TargetNamespace="urn:open62541.server.application"
TargetVersion="0.1.0"
TargetPublicationDate="2022-05-02T00:00:00Z"
xmlns="https://opcfoundation.org/UA/ModelDesign.xsd">

<Namespaces>
<Namespace Name="opcua" Prefix="opcua" Version="1.03" PublicationDate="2013-12-02T00:00:00Z">https://opcfoundation.org/UA/&l.....ce&gt;
<Namespace Name="safety" Prefix="safety" PublicationDate="2022-06-28T00:00:00Z" Version="1.05.02">https://opcfoundation.org/UA/Sa.....ce&gt;
<Namespace Name="Demo" Prefix="Demo">urn:open62541.server.application</Namespace>
</Namespaces>

<!-- ### Object ###-->

<Object SymbolicName="Demo:MySafetyObj" TypeDefinition="safety:SafetyProviderType">
</Object>

</ModelDesign>

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
06/02/2023 - 19:46
sp_Permalink sp_Print sp_EditHistory

From the README:

Opc.Ua.ModelCompiler compile -d2 .\Opc.Ua.Machinery.NodeSet2.xml,Opc.Ua.Machinery,Machinery -d2 Opc.Ua.Di.NodeSet2.xml,Opc.Ua.DI,DI -version v105 -exclude Draft -o2 .\output

The target file is the first -d2.

If the file is a NodeSet it needs the prefix and model name appended to the file name since this information is not in the file.

Avatar
FarNA
Member
Members
Forum Posts: 4
Member Since:
05/12/2023
sp_UserOfflineSmall Offline
3
06/04/2023 - 13:58
sp_Permalink sp_EditHistory
Awaiting Moderation

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
06/04/2023 - 23:02
sp_Permalink sp_Print

This is weird.

The only logical explanation is the app.xml being loaded by the tool is not the app.xml you think is being loaded.

Try an absolute path.

Also check the namespace uri on the MyTestObj. That would tell you the source of the object.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 13
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1347
Posts: 4567