OPC UA Model.xml Change IdentifierType from Numeric to String

47 Views Asked by At

I'm developing an OPC UA Server based on the UA Sample Server example provided by OPC Foundation. The server keeps the opc information from a NodeSet2 xml file which is generated from the OPC UA Model Compiler which takes the Model.xml file and perform a translation.

I made my own model design xml file. I would like the identifier type of some nodes to be string. I'd like to have, on my nodeset2 file, tags whose IdentifierType is String so the NodeId is like "ns=1;s=NodeName"

I setted up this type on model design file

<opc:ObjectType SymbolicName="GenericSensorType" BaseType="ua:BaseObjectType">
<opc:Description>Generic Sensor</opc:Description>
<opc:Children>
  <opc:Variable SymbolicName="Output" DataType="ua:Double" ValueRank="Scalar" TypeDefinition="ua:AnalogItemType" />
  <opc:Property SymbolicName="Units" DataType="ua:Double" ValueRank="Scalar" AccessLevel="ReadWrite"/>
</opc:Children>
</opc:ObjectType>

On the nodeset2 file this becomes

<UAObjectType NodeId="ns=1;i=1" BrowseName="1:GenericSensorType">
<DisplayName>GenericSensorType</DisplayName>
<Description>Generic Sensor</Description>
<References>
  <Reference ReferenceType="HasComponent">ns=1;i=2</Reference>
  <Reference ReferenceType="HasProperty">ns=1;i=8</Reference>
  <Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference>
</References>
</UAObjectType>

On that example the NodeId is NodeId="ns=1;i=1" instead I'd like to have NodeId="ns=1;s=GenericSensorType". Is there a way to fix this by changing something on the model design file? Or, if it's not possible from the model design, is there any other way to change the NodeId type (if I understood correctly i is for Numeric and s is for String) from Numeric to String?

0

There are 0 best solutions below