01/28/2019
I'm new to OPC UA and am trying to integrate the UA-.NETStandard server with a custom application using an information model written in ModelDesign XML and compiled with the UA-ModelCompiler. Some of the variables are of type ua:AnalogItemType and I want to specify engineering units for them. However the compiled models appear to include only the EURange property, not the EngineeringUnits or property (based on the generated NodeSet2.xml, and the BaseAnalogState.EngineeringUnits field in the generated code is null). How can I specify in the ModelDesign XML that the EngineeringUnits property should be generated, and if possible specify a default engineering unit?
Thanks for the help,
Andrew
05/30/2017
Define the Property explicitly and add a DefaultValue using the XML syntax:
e.g.:
<ExtensionObject xmlns="https://opcfoundation.org/UA/2008/02/Types.xsd"> <TypeId> <Identifier>i=297</Identifier> </TypeId> <Body> <Argument> <Name>SubscriptionId</Name> <DataType> <Identifier>i=7</Identifier> </DataType> <ValueRank>-1</ValueRank> <ArrayDimensions /> </Argument> </Body> </ExtensionObject>
01/28/2019
Thanks for the prompt reply, Randy. However, I'm still a bit confused. Is this syntax for the ModelDesign XML? If so, how does it relate to the declaration of the AnalogItemType variable? I tried it both as an embedded tag within the variable declaration, and placing it within an embedded <opc:Children> tag, but neither appeared to have any effect. For example:-
<opc:Variable SymbolicName="SetValue" TypeDefinition="ua:AnalogItemType" AccessLevel="ReadWrite">
<ExtensionObject xmlns="https://opcfoundation.org/UA/2008/02/Types.xsd">
....
</ExtensionObject>
</opc:Variable>
or
<opc:Variable SymbolicName="SetValue" TypeDefinition="ua:AnalogItemType" AccessLevel="ReadWrite">
<opc:Children>
<ExtensionObject xmlns="https://opcfoundation.org/UA/2008/02/Types.xsd">
....
</ExtensionObject>
</opc:Children>
</opc:Variable>
The syntax looks more like that of the NodeSet2.xml, but I'm trying if possible to enable the EngineeringUnits property from the ModelDesign.xml file, so that if I regenerate NodeSet2.xml then it won't be overwritten.
Apologies if i have misunderstood your reply and thanks again for the help,
Andrew
1 Guest(s)