UA-.NETStandard: Enabling EngineeringUnits in ua:AnalogItemType|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
UA-.NETStandard: Enabling EngineeringUnits in ua:AnalogItemType
Avatar
Andrew Roos
Member
Members
Forum Posts: 3
Member Since:
01/28/2019
sp_UserOfflineSmall Offline
1
05/02/2019 - 07:23
sp_Permalink sp_Print

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

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
05/02/2019 - 12:53
sp_Permalink sp_Print

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>
Avatar
Andrew Roos
Member
Members
Forum Posts: 3
Member Since:
01/28/2019
sp_UserOfflineSmall Offline
3
05/03/2019 - 01:15
sp_Permalink sp_Print

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

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
05/03/2019 - 07:00
sp_Permalink sp_Print

I suggest you look at existing design files to find the exact syntax (in the Design subdir).

Search for "DefaultValue".

Once you find an example it should be obvious what to do.

Note that you need to change the XML to the EUInformation syntax with EUInformation XML Encoding ID.

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