09/12/2014
In the past I've used commercial UA SDKs and have always been able to use the available modelling tool to generate my own complex data types and use them within my server.
Due to restrictions on my new platform, I'm now trying to use the open source .NET standard UA SDK which can be found here on github:
https://github.com/OPCFoundati.....ETStandard
In the example for this SDK, an XML and CSV file get passed to the OPC ModelCompiler for generating C# classes. It's my understanding that if I want to create my own complex data types that I need to manipulate the csv and xml file passed to the ModelCompiler. So my question is, what tool is used to create the stock Boiler example that this SDK is shipped with. I think I need that tool to create my own types. I did try to use my Unified Automation UAModeller tool to generate the XML file but this raises errors in the ModelCompiler tool due to the xml being a different format. Surely some tool exists that is generating the XML file rather than it being done by hand. By way of an example, here is the start of the XML file that is the type I'm looking for a tool to generate:
<opc:ModelDesign TargetNamespace="https://opcfoundation.org/UA/Boiler/" xmlns="https://opcfoundation.org/UA/Boiler/" xmlns:uax="https://opcfoundation.org/UA/2008/02/Types.xsd" xmlns:ua="https://opcfoundation.org/UA/" xmlns:opc="https://opcfoundation.org/UA/ModelDesign.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><opc:Namespaces><opc:Namespace XmlNamespace="https://opcfoundation.org/UA/2008/02/Types.xsd" InternalPrefix="Opc.Ua.Server" Prefix="Opc.Ua" Name="OpcUa">https://opcfoundation.org/UA/&.....ce><opc:Namespace Prefix="Boiler" Name="Boiler">https://opcfoundation.org/UA/B.....es><opc:ReferenceType BaseType="ua:NonHierarchicalReferences" SymbolicName="FlowTo"><opc:Description>A reference that indicates a flow between two objects.</opc:Description><opc:InverseName>FlowFrom</opc:InverseName></opc:ReferenceType><opc:ReferenceType BaseType="FlowTo" SymbolicName="HotFlowTo"><opc:Description>A reference that indicates a high temperature flow between two objects.</opc:Description><opc:InverseName>HotFlowFrom</opc:InverseName></opc:ReferenceType><opc:ReferenceType BaseType="ua:NonHierarchicalReferences" SymbolicName="SignalTo"><opc:Description>A reference that indicates an electrical signal between two variables.</opc:Description><opc:InverseName>SignalFrom</opc:InverseName></opc:ReferenceType><opc:ObjectType BaseType="ua:BaseObjectType" SymbolicName="GenericControllerType"><opc:Description>A generic PID controller</opc:Description><opc:Children><opc:Property SymbolicName="Measurement" ValueRank="Scalar" DataType="ua:Double"/><opc:Property SymbolicName="SetPoint" ValueRank="Scalar" DataType="ua:Double" AccessLevel="ReadWrite"/><opc:Property SymbolicName="ControlOut" ValueRank="Scalar" DataType="ua:Double"/></opc:Children></opc:ObjectType><opc:ObjectType BaseType="ua:BaseObjectType" SymbolicName="GenericSensorType"><opc:Description>A generic sensor that read a process value.</opc:Description><opc:Children><opc:Variable SymbolicName="Output" ValueRank="Scalar" DataType="ua:Double" TypeDefinition="ua:AnalogItemType"/></opc:Children></opc:ObjectType>....
Thanks in advance,
Lee
06/15/2017
There's no tool - but
it's fairly straightforward to write the XML by hand because the XSD is available (though not very well documented imho).
Otherwise, I wrote my own tooling to generate XML from a dataset that I wanted to expose through OPC-UA. Basically, it is python code that casts objects taken from the dataset to a modeldesign.xml. I found the lxml python module to be helpful. You may want to explore this route if you need to do create larger address spaces.
Yours,
Bob
11/21/2015
A collegue just crashed on the same issue yesterday and is now working on adding ModelDesign support to the open source ua modeler https://github.com/FreeOpcUa/o.....ua-modeler . It is probably just a few hours work to modify current xml exporter
so you will probably have a graphical editor soon.
07/12/2016
I wrote a Tutorial on how to create custom NodeSet2.xml files using the official OPC Foundation's UA-ModelCompiler:
https://opcua.rocks/custom-inf.....on-models/
Feel free to comment and give feedback below the blog post.
The UA-ModelCompiler needs as input a manually Written Model.xml file, which is much simpler than the NodeSet2.xml file. It also does a lot of checking while converting. This ensures that the resulting NodeSet2.xml file is valid.
05/30/2017
Added link from Readme on GitHub:
01/28/2019
I'm sure it's too late to help the OP, but for anyone else who stumbles on the thread, Beeyond UMX (https://beeond.net/opc-ua-products/) is a simple free application that generates ModelDesign XML files for the ModelCompiler. It's very simple and does not diagram the information model, but is less intimidating for a beginner than starting with an empty text document.
1 Guest(s)