Instances
Use instances: to make nodes in the address space of the gateway.
An entry makes one Object or one Variable and puts it under a parent node.
The mapping: section can then connect these nodes to the data of a device.
For many similar instances (doors, machines, tanks), write one template and repeat it.
Words on this page
| Word | Meaning |
|---|---|
| ObjectType | A type from a NodeSet2.xml file. It defines the members of an Object. |
typeDefinition | The key that names the type of an Object. |
| parent reference | The key that puts the node under a parent: organizedBy, componentOf, propertyOf, orderedComponentOf, physicalComponentOf or containedComponentOf. |
own | The namespace alias of the nodes that instances: makes. It is namespace 1. |
| browse path | A path of browse names: /ua:Objects/di:DeviceSet/own:DistanceSensor. See aliased browse paths. |
The rules of an entry
Each entry has a browseName: and a parent reference.
- An entry with
typeDefinition:makes an Object from the ObjectType that the key names. - An entry with
dataType:and withouttypeDefinition:makes a Variable. - An Object entry must have
typeDefinition:. The gateway refuses an entry without it. - The gateway does not support the
di:andfx:blocks of the OPC UA Modeler. The gateway refuses an entry with one of these blocks. SettypeDefinition:. - An entry has exactly one parent reference. If an entry has more than one, or none, the gateway refuses it.
orderedComponentOf,physicalComponentOfandcontainedComponentOfmake aHasOrderedComponent,HasPhysicalComponentorHasContainedComponentreference from the parent.propertyOfis only for a Variable of the typeua:PropertyType. For another Variable, usecomponentOfororganizedBy.- The value of a parent reference is the browse path of an existing node. If the gateway cannot find the parent, it reports an error.
- The gateway refuses an empty parent reference. To put the node in the Objects folder, write
/ua:Objects.
The gateway makes each node in namespace 1.
The alias of this namespace is own.
A browse path that goes through such a node uses own:: /ua:Objects/di:DeviceSet/own:DistanceSensor.
How to make an Object from an ObjectType
- Add the NodeSet2.xml file of the type to
imports:. Add the companion specifications that it uses, for exampledi, tonamespaces:. - Add an entry to
instances:. - Set
browseName:to the name of the new Object. - Set
typeDefinition:to the type:t1:DistanceSensorType.t1is the alias of the import. - Set a parent reference to the browse path of the parent. To put the Object in the
DeviceSetfolder of DI, setorganizedBy: /ua:Objects/di:DeviceSet.
The gateway makes the mandatory members of the type.
To make an optional member, name it in optionals:.
namespaces:
- di
imports:
- alias: t1
filename: ./company.Nodeset2.xml
instances:
- browseName: DistanceSensor
typeDefinition: t1:DistanceSensorType
organizedBy: /ua:Objects/di:DeviceSet
The browse path of the new Object is /ua:Objects/di:DeviceSet/own:DistanceSensor.
How to make a Variable
- Add an entry to
instances:. - Set
browseName:to the name of the Variable. - Set
dataType:, for exampleua:Double. - Do not set
typeDefinition:. - Set a parent reference to the browse path of the parent Object.
namespaces:
- di
instances:
- browseName: TemperatureSensor
typeDefinition: ua:BaseObjectType
organizedBy: /ua:Objects/di:DeviceSet
- browseName: Temperature
componentOf: /ua:Objects/di:DeviceSet/own:TemperatureSensor
dataType: ua:Double
Keys of an entry
| Key | Required | Meaning |
|---|---|---|
browseName | Required | The name of the node. |
typeDefinition | Required for an Object | The type of the Object, as alias:TypeName. |
dataType | Required for a Variable | The data type of the Variable, as alias:TypeName. |
organizedBy, componentOf, propertyOf, orderedComponentOf, physicalComponentOf, containedComponentOf | One of the six | The browse path of the parent node. |
optionals | Optional | The optional members of the type to make. |
nodeId | Optional | A string node id, for example s=MyMachine. Without it, the gateway chooses a number. |
displayName, description | Optional | The texts that an OPC UA client shows. |
valueRank, arrayDimensions, accessLevel, historizing, minimumSamplingInterval | Optional | The attributes of a Variable. |
The reference of all keys is in instances.