Namespaces and imports
Use namespaces: and imports: to load the OPC UA NodeSet2.xml files that the gateway needs.
These files define the types: companion specifications such as Device Integration (DI), and your own models.
The instances: section can then make nodes from these types.
Words on this page
| Word | Meaning |
|---|---|
| NodeSet2.xml | An XML file that defines the types and the nodes of an OPC UA model. |
| companion specification | A standard model of the OPC Foundation, for example DI or Machinery. |
| namespace alias | The short prefix of a namespace: di, t. A browse path uses it: di:DeviceSet. |
How to load a companion specification
- Find the alias in the list of namespace aliases.
- Add the alias to
namespaces:.
The gateway includes these NodeSet2.xml files.
The gateway adds the dependencies of each one and loads them in the correct order.
If you list adi, the gateway loads di first.
The standard namespace ua is always loaded. Do not list it.
How to load your own NodeSet2.xml file
- Put the file in the folder of the configuration file, or in a folder below it.
- Add an entry to
imports:. - Set
alias:to the short name that browse paths use for the model. - Set
filename:to the path of the file, relative to the configuration file. - Set
uri:to the namespace URI that the file declares.
The gateway needs alias: and at least one of uri: and filename:.
If you set both, the gateway checks that the file it loads has this uri:.
A complete example
namespaces:
- di
- machinery
imports:
- alias: t
uri: http://sterfive.com/UA/MyAnalyserDevice/
filename: ./model/MyAnalyserDevice.Nodeset2.xml
A browse path refers to the nodes of these models with the alias: di:DeviceSet, t:AnalyserDeviceType.
The instances section can make instances of their types.
Keys of an imports: entry
| Key | Required | Meaning |
|---|---|---|
alias | Required | The short name that browse paths use for the model. |
uri | One of uri and filename | The namespace URI that the NodeSet2.xml file declares. |
filename | One of uri and filename | The NodeSet2.xml file, relative to the folder of the configuration file. |
publicationDate | Optional | The gateway requires a NodeSet2.xml file published on this date or later. |
sha256 | Optional | The sha256 hash that the file must have. |
The key reference is in namespaces and imports.
Notes
- The gateway loads the NodeSet2.xml files when it builds the address space. A change takes effect when the gateway loads the configuration again or restarts.
- The nodes that
instances:makes are in namespace 1. Its alias isown:own:DistanceSensor. - A modelling tool, for example the OPC UA Modeler, makes, documents and versions NodeSet2.xml files.
How to convert a configuration file of version 3
Version 3 used one key, nodesets:, with nodeset2: for the file:
# Version 3: the current gateway refuses this form.
nodesets:
- di
- alias: t
nodeset2: ./model/MyAnalyserDevice.Nodeset2.xml
The current gateway refuses this form and shows a message that says so.
- Run
opcua-omni-edge migrate-config config.yaml. The command changes the file in place. - To see the result without a change to the file, add
--dry-run.
opcua-omni-edge migrate-config config.yaml