SlideShare a Scribd company logo
1 of 34
Download to read offline
Practical usage of OPC
UA information models
Eero Laukkanen
Why to model?
Interoperability with
common information
models
Information
organization with
types and relations
How to model?
(server-side example)
Address space
Types Objects
1. Create types
Types Objects
Model
UaModeler
<UAObjectType NodeId="ns=1;i=1001" BrowseName="1:ValveType">
<DisplayName>ValveType</DisplayName>
<References>
<Reference ReferenceType="HasProperty">ns=1;i=6012</Reference>
<Reference ReferenceType="HasComponent">ns=1;i=6010</Reference>
<Reference ReferenceType="HasComponent">ns=1;i=6011</Reference>
<Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference>
</References>
</UAObjectType>
<UAVariable DataType="Date" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6012" Browse
<DisplayName>BestBefore</DisplayName>
<References>
<Reference ReferenceType="HasModellingRule">i=78</Reference>
<Reference ReferenceType="HasTypeDefinition">i=68</Reference>
<Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=1001</Refe
</References>
</UAVariable>
<UAVariable DataType="Double" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6010" Brow
XML
TypesTypes
Model XML Types
<UAObjectType NodeId="ns=1;i=1001" BrowseName="1:ValveType">
<DisplayName>ValveType</DisplayName>
<References>
<Reference ReferenceType="HasProperty">ns=1;i=6012</Reference>
<Reference ReferenceType="HasComponent">ns=1;i=6010</Reference>
<Reference ReferenceType="HasComponent">ns=1;i=6011</Reference>
<Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference>
</References>
</UAObjectType>
<UAVariable DataType="Date" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6012"
BrowseName="1:BestBefore" UserAccessLevel="3" AccessLevel="3">
<DisplayName>BestBefore</DisplayName>
<References>
<Reference ReferenceType="HasModellingRule">i=78</Reference>
<Reference ReferenceType="HasTypeDefinition">i=68</Reference>
<Reference ReferenceType="HasProperty"
IsForward="false">ns=1;i=1001</Reference>
</References>
</UAVariable>
<UAVariable DataType="Double" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6010"
BrowseName="1:Flow" UserAccessLevel="3" AccessLevel="3">
<DisplayName>Flow</DisplayName>
<References>
<Reference ReferenceType="HasTypeDefinition">i=63</Reference>
<Reference ReferenceType="HasModellingRule">i=78</Reference>
<Reference ReferenceType="HasComponent"
IsForward="false">ns=1;i=1001</Reference>
</References>
</UAVariable>
<UAVariable DataType="Boolean" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6011"
BrowseName="1:IsOpen" UserAccessLevel="3" AccessLevel="3">
<DisplayName>IsOpen</DisplayName>
<References>
<Reference ReferenceType="HasTypeDefinition">i=63</Reference>
<Reference ReferenceType="HasModellingRule">i=78</Reference>
<Reference ReferenceType="HasComponent"
IsForward="false">ns=1;i=1001</Reference>
</References>
</UAVariable>
MANUAL
2. Create objects
Types Objects
Java
classes
Application
code Objects
Model XML Types
MANUAL
MANUAL MANUAL
Problems?

Manual work

Error-prone

Solution?

Create objects
from the types

XML
Application
code
Objects
Model XML Types
MANUAL
MANUAL
Generate
Java classes

// using "pure" nodes
UaNode valve = …;
double flow = (Double) valve.getComponent("Flow").getValue();
boolean isOpen = (Boolean) valve.getComponent("IsOpen").getValue();
DateTime bestBefore = (DateTime)
valve.getProperty("BestBefore").getValue();
// using generated Java class
ValveType valve = …;
double flow = valve.getFlowValue();
Boolean isOpen = valve.getIsOpenValue();
DateTime bestBefore = valve.getBestBefore();
XML
Application
code
Objects
Model XML TypesXML
Java
classes
Application
code 
MANUAL
MANUAL
Ready yet?
Code generator
XML Templates
Generator
Java classes
public class {{name}} {
{{#fields}}
{{type}} {{name}};
{{/fields}}
}
public class ValveType {
double flow;
boolean isOpen;
DateTime bestBefore;
}
Creating objects
// create valve object
NodeManagerUaNode manager = …;
NodeId valveTypeId = …;
ValveType valve =
manager.createNodeWithTypeAndName(valveTypeId, "Valve1");
// add object to the address space
UaObject objects = manager.getNode(Identifiers.ObjectsFolder);
objects.addComponent(valve);
// use the object
valve.setFlowValue(0.674);
valve.setIsOpenValue(true);
DateTime bestBefore = DateTime.parseDateTime("2024-11-16");
valve.setBestBeforeValue(bestBefore);
Questions?
eero@prosysopc.com
prosysopc.com

More Related Content

Similar to Practical usage of OPC UA information models (8)

Data models pivot with splunk break out session
Data models pivot with splunk break out sessionData models pivot with splunk break out session
Data models pivot with splunk break out session
 
SplunkLive! Data Models 101
SplunkLive! Data Models 101SplunkLive! Data Models 101
SplunkLive! Data Models 101
 
Data Models Breakout Session
Data Models Breakout SessionData Models Breakout Session
Data Models Breakout Session
 
SplunkLive! Analytics with Splunk Enterprise
SplunkLive! Analytics with Splunk EnterpriseSplunkLive! Analytics with Splunk Enterprise
SplunkLive! Analytics with Splunk Enterprise
 
ASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp PresentationASP.net MVC CodeCamp Presentation
ASP.net MVC CodeCamp Presentation
 
Analytics with splunk - Advanced
Analytics with splunk - AdvancedAnalytics with splunk - Advanced
Analytics with splunk - Advanced
 
SplunkLive! Analytics with Splunk Enterprise - Part 2
SplunkLive! Analytics with Splunk Enterprise - Part 2SplunkLive! Analytics with Splunk Enterprise - Part 2
SplunkLive! Analytics with Splunk Enterprise - Part 2
 
Handout for Metadata for Visual Resources
Handout for Metadata for Visual ResourcesHandout for Metadata for Visual Resources
Handout for Metadata for Visual Resources
 

More from Eero Laukkanen

More from Eero Laukkanen (6)

Comparison of release engineering practices in a large mature company and a s...
Comparison of release engineering practices in a large mature company and a s...Comparison of release engineering practices in a large mature company and a s...
Comparison of release engineering practices in a large mature company and a s...
 
Towards continuous delivery by reducing the feature freeze period: a case study
Towards continuous delivery by reducing the feature freeze period: a case studyTowards continuous delivery by reducing the feature freeze period: a case study
Towards continuous delivery by reducing the feature freeze period: a case study
 
Bottom-up Adoption of Continuous Delivery in a Stage-gate Managed Software Or...
Bottom-up Adoption of Continuous Delivery in a Stage-gate Managed Software Or...Bottom-up Adoption of Continuous Delivery in a Stage-gate Managed Software Or...
Bottom-up Adoption of Continuous Delivery in a Stage-gate Managed Software Or...
 
Continuous Integration, Delivery and Deployment
Continuous Integration, Delivery and DeploymentContinuous Integration, Delivery and Deployment
Continuous Integration, Delivery and Deployment
 
Stakeholder Perceptions of the Adoption of Continuous Integration – A Case Study
Stakeholder Perceptions of the Adoption of Continuous Integration – A Case StudyStakeholder Perceptions of the Adoption of Continuous Integration – A Case Study
Stakeholder Perceptions of the Adoption of Continuous Integration – A Case Study
 
Build waiting time in continuous integration
Build waiting time in continuous integrationBuild waiting time in continuous integration
Build waiting time in continuous integration
 

Recently uploaded

Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Lisi Hocke
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
drm1699
 

Recently uploaded (20)

Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
Team Transformation Tactics for Holistic Testing and Quality (NewCrafts Paris...
 
Community is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea GouletCommunity is Just as Important as Code by Andrea Goulet
Community is Just as Important as Code by Andrea Goulet
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
Abortion Pill Prices Mthatha (@](+27832195400*)[ 🏥 Women's Abortion Clinic In...
 
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptxFrom Knowledge Graphs via Lego Bricks to scientific conversations.pptx
From Knowledge Graphs via Lego Bricks to scientific conversations.pptx
 
Encryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key ConceptsEncryption Recap: A Refresher on Key Concepts
Encryption Recap: A Refresher on Key Concepts
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14Spring into AI presented by Dan Vega 5/14
Spring into AI presented by Dan Vega 5/14
 
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
Abortion Pills For Sale WhatsApp[[+27737758557]] In Birch Acres, Abortion Pil...
 
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-CloudAlluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
Alluxio Monthly Webinar | Simplify Data Access for AI in Multi-Cloud
 
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
Navigation in flutter – how to add stack, tab, and drawer navigators to your ...
 
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
CERVED e Neo4j su una nuvola, migrazione ed evoluzione di un grafo mission cr...
 
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdfThe Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
The Evolution of Web App Testing_ An Ultimate Guide to Future Trends.pdf
 
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
Abortion Pill Prices Turfloop ](+27832195400*)[ 🏥 Women's Abortion Clinic in ...
 
Your Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | EvmuxYour Ultimate Web Studio for Streaming Anywhere | Evmux
Your Ultimate Web Studio for Streaming Anywhere | Evmux
 

Practical usage of OPC UA information models

  • 1. Practical usage of OPC UA information models Eero Laukkanen
  • 10. <UAObjectType NodeId="ns=1;i=1001" BrowseName="1:ValveType"> <DisplayName>ValveType</DisplayName> <References> <Reference ReferenceType="HasProperty">ns=1;i=6012</Reference> <Reference ReferenceType="HasComponent">ns=1;i=6010</Reference> <Reference ReferenceType="HasComponent">ns=1;i=6011</Reference> <Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference> </References> </UAObjectType> <UAVariable DataType="Date" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6012" Browse <DisplayName>BestBefore</DisplayName> <References> <Reference ReferenceType="HasModellingRule">i=78</Reference> <Reference ReferenceType="HasTypeDefinition">i=68</Reference> <Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=1001</Refe </References> </UAVariable> <UAVariable DataType="Double" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6010" Brow XML
  • 12. Model XML Types <UAObjectType NodeId="ns=1;i=1001" BrowseName="1:ValveType"> <DisplayName>ValveType</DisplayName> <References> <Reference ReferenceType="HasProperty">ns=1;i=6012</Reference> <Reference ReferenceType="HasComponent">ns=1;i=6010</Reference> <Reference ReferenceType="HasComponent">ns=1;i=6011</Reference> <Reference ReferenceType="HasSubtype" IsForward="false">i=58</Reference> </References> </UAObjectType> <UAVariable DataType="Date" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6012" BrowseName="1:BestBefore" UserAccessLevel="3" AccessLevel="3"> <DisplayName>BestBefore</DisplayName> <References> <Reference ReferenceType="HasModellingRule">i=78</Reference> <Reference ReferenceType="HasTypeDefinition">i=68</Reference> <Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=1001</Reference> </References> </UAVariable> <UAVariable DataType="Double" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6010" BrowseName="1:Flow" UserAccessLevel="3" AccessLevel="3"> <DisplayName>Flow</DisplayName> <References> <Reference ReferenceType="HasTypeDefinition">i=63</Reference> <Reference ReferenceType="HasModellingRule">i=78</Reference> <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=1001</Reference> </References> </UAVariable> <UAVariable DataType="Boolean" ParentNodeId="ns=1;i=1001" NodeId="ns=1;i=6011" BrowseName="1:IsOpen" UserAccessLevel="3" AccessLevel="3"> <DisplayName>IsOpen</DisplayName> <References> <Reference ReferenceType="HasTypeDefinition">i=63</Reference> <Reference ReferenceType="HasModellingRule">i=78</Reference> <Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=1001</Reference> </References> </UAVariable> MANUAL
  • 14.
  • 21.
  • 24. // using "pure" nodes UaNode valve = …; double flow = (Double) valve.getComponent("Flow").getValue(); boolean isOpen = (Boolean) valve.getComponent("IsOpen").getValue(); DateTime bestBefore = (DateTime) valve.getProperty("BestBefore").getValue(); // using generated Java class ValveType valve = …; double flow = valve.getFlowValue(); Boolean isOpen = valve.getIsOpenValue(); DateTime bestBefore = valve.getBestBefore();
  • 29. public class {{name}} { {{#fields}} {{type}} {{name}}; {{/fields}} }
  • 30. public class ValveType { double flow; boolean isOpen; DateTime bestBefore; }
  • 32. // create valve object NodeManagerUaNode manager = …; NodeId valveTypeId = …; ValveType valve = manager.createNodeWithTypeAndName(valveTypeId, "Valve1"); // add object to the address space UaObject objects = manager.getNode(Identifiers.ObjectsFolder); objects.addComponent(valve); // use the object valve.setFlowValue(0.674); valve.setIsOpenValue(true); DateTime bestBefore = DateTime.parseDateTime("2024-11-16"); valve.setBestBeforeValue(bestBefore);
  • 33.