Dear Community User! We are updating our platform to a new system.
Read more: Important information on the platform change.

Load you own specific OPC UA Information model

How-to run an OPC UA Information Model on ctrlX OPC UA Server

smueller
Established Member

OPC UA provides a powerful information modelling functions, which allows you to define standardized information in syntax and semantic. There a lot of collaboration between OPC Foundation and other standardizdation organization active, which aims to create a domain specific information model. An overview of the current collaboration can found here.

With version 2.04 the ctrlX OPC UA Server supports to load your own or standardized OPC UA Information Models on the ctrlX and thus represents your data as you required in the OPC UA Addressspace. To fill your OPC UA Information Models with data from ctrlX Data Layer you have to do a mapping for the corresponding data.

This how-to shows you the steps to generate and load the required files for ctrlX OPC UA Server out of your OPC UA NodeSets files containing your OPC UA Information Models.

Getting an OPC UA Information Model

The most common ways to get an OPC UA Information Model is creating your own one by using a Modelling Tool like UaModeler or use one or more standardized OPC UA Information Model. Normally, you combine your own Information Model with your instance data and reference this to nodes of one or more standardized OPC UA Information Models.

Standardized OPC UA Information Model

There are a lot of OPC UA Information Model either as part of the OPC UA specification or as a separate OPC UA Companion specification, e.g. the PLCopen or the MachineTool. The nodes of such OPC UA Information Models are described in OPC UA NodeSets which can be found here. Based on that OPC UA NodeSets XML you can generate a bin-files, which can be used in our ctrlX OPC UA Server. This is described in the next section.

UA-Nodesets on GitHub OPC FoundationUA-Nodesets on GitHub OPC Foundation

UaModeler

The UaModeler allows you to simple create your own OPC UA Information Model as also extend an existing OPC UA Information Models with your own nodes, e.g. instances from ObjectTypes and VariableTypes of provided standard. After your OPC UA Information Model is ready just export it to OPC UA NodeSet XML as shown below. Based on that OPC UA NodeSets XML you can generate a bin-files, which can be used in our ctrlX OPC UA Server. This is described in the next section. 

UaModeler: Creating your own OPC UA Information Model and export it to OPC UA NodeSet XML.UaModeler: Creating your own OPC UA Information Model and export it to OPC UA NodeSet XML.

Load OPC UA Information Models to ctrlX CORE

Before loading the OPC UA Information Models to ctrlX Core we have to convert the OPC UA NodeSets XML files to the binary files required for the ctrlX OPC UA Server. Therefore we provide the XML2Bin Package (xml2binPackage.zip) in the App Data. This enables the easy conversion of OPC UA NodeSets XML files into binary files.
These binary files can then be loaded into the ctrlX OPC UA Server to provide the information models described in the NodeSet XML files.

The XML2Bin Package you find as xml2binPackage.zip in the OPC UA Server App Data under "opcuaserver/companion-config/tools". Please download this package:

Download the XML2Bin Package from App Data.Download the XML2Bin Package from App Data.

To accomplish the XML2Bin, follow these steps:

First three steps to accomplish the XML2Bin PackageFirst three steps to accomplish the XML2Bin Package

  1. Extract all files from the xml2binPackage into a single folder
  2. Add all of your OPC UA NodeSet XML files (e.g., Opc.Ua.Di.NodeSet2.xml) to this folder.
  3. Run the xml2binExtended.bat script from the command line, passing the OPC UA NodeSet XML files as arguments.
    The order of dependency needs to be taken into account.
    This means that the first nodeset should only depend on the standard OPC UA NodeSet (Opc.Ua.NodeSet2.xml).
    The subsequent nodesets should only depend on nodesets that come before it in the sequence (to the left of it).
    The order of the Dependency of the Information Models has to be take in account.The order of the Dependency of the Information Models has to be take in account.In addition to the binary files, text files are also generated. These text files contain the results of the generation process for the corresponding binary files.
  4. Copy the generated binary files to the ctrlX App Data folder opcuaserver/companion-config/.Result of xml2bin process. Copy the bin-files to ctrlX App Data.Result of xml2bin process. Copy the bin-files to ctrlX App Data.
  5. Restart the ctrlX OPC UA Server.Step 5: Restart OPC UA Server over ctrlX Web Interface.Step 5: Restart OPC UA Server over ctrlX Web Interface.

After restart you can inspect the loaded and not loaded bin-files over the Data Layer addresses "opcuaserver/companion-model/loaded-bin-files" and "opcuaserver/companion-model/-not-loaded-bin-files". This functionality is available at Version 2.6 of the ctrlX OPC UA Server.Inspect the loaded bin-files on ctrlX  OPC UA Server in Data Layer.Inspect the loaded bin-files on ctrlX OPC UA Server in Data Layer.

If all bin-files are correctly loaded you can already browse the OPC UA Addressspace of your newly added OPC UA Information models. But for all Variables to will get a "Null" Value. Therefore you have proceed with the mapping described in the next section.

See the loaded OPC UA Information Model in the ctrlX OPC UA Server Addressspace.See the loaded OPC UA Information Model in the ctrlX OPC UA Server Addressspace.

Map data from Data Layer on OPC UA Information Models

After loading the OPC UA Information Models you can start to map the data from Data Layer to Variables and Methods Nodes of the OPC UA Information Models. Therefore you have to create a mapping via the Data Layer address "opcuaserver/companion-model/mappings". This can be done over the ctrlX OPC UA Server or directly in Data Layer over ctrlX Web Interface (Settings->Data Layer).

Follow this steps to create a mapping:

  1. Call "create" on the Data Layer address "opcuaserver/companion-model/mappings"
  2. Define a name for your mapping (in example "umati"). Also activate "typeSafety" if required. This checks for every mapping entry in the table that target and source node have the same datatype. Next fill out the mapping table. Every entry in the table contain the "sourceUaNodeId" and the "targetUaNodeId". In "sourceUaNodeId" you write the OPC UA NodeId of a Data Layer node which provides the data for the target node. In "targetUaNodeId" you write the OPC UA NodeId of a node from before loaded OPC UA Information Model. Please use "sourceUaNodeId" and "targetUaNodeId" the string formatting as defined here.
    1. (UaExpert only) To create one or more entry in the mapping table please press "..." on "mappingTable" and again "..." on "$$S:comm.opcua.server.companion.NodeIdMapping Array[0]"
    2. (UaExpert only) Then extend the array size to wished size.
    3. (UaExpert only) Fill out the table with wished parameters.
  3. Press create on the dialog and the corresponding mappingTable will be created. You can still modify the table under the Data Layer Address "opcuaserver/companion-model/mappings/<definedMappingName>".

Mapping Data Layer nodes to OPC UA Nodes. Left side using UaExpert over ctlX OPC UA Server. Right side using Data Layer over the Data Layer Editor.Mapping Data Layer nodes to OPC UA Nodes. Left side using UaExpert over ctlX OPC UA Server. Right side using Data Layer over the Data Layer Editor.

The result

After finishing the mapping you can immediately read, write and subscribe the values or call the methods via the ctrlX OPC UA Server. You can still adapt you mapping via the Data Layer Address "opcuaserver/companion-model/mappings/<definedMappingName>".

The result of the mapping.The result of the mapping.

App Data

The mapping table will be saved in App Data under "opcuaserver/companion-config/mappings" of the ctrlX OPC UA Server. As the binary files of the OPC UA Information models also saved in the App Data you can easily transfer this between different controls using the ctrlX CORE mechanism.

Mapping Table are saved in App Data as json and can port easly to other controls.Mapping Table are saved in App Data as json and can port easly to other controls.

smueller
smueller
Hi, I am Sebastian and I work as Senior Software Developer and Product Owner of the ctrlX OPC UA Software Team. We develop for you our popular ctrlX OPC UA Apps Server, Client and Pub/Sub. Please contact me if you have questions regarding our Apps and Solutions.
Must Read
Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist