Skip to main content

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.

tip

For many similar instances (doors, machines, tanks), write one template and repeat it.

Words on this page​

WordMeaning
ObjectTypeA type from a NodeSet2.xml file. It defines the members of an Object.
typeDefinitionThe key that names the type of an Object.
parent referenceThe key that puts the node under a parent: organizedBy, componentOf, propertyOf, orderedComponentOf, physicalComponentOf or containedComponentOf.
ownThe namespace alias of the nodes that instances: makes. It is namespace 1.
browse pathA 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 without typeDefinition: makes a Variable.
  • An Object entry must have typeDefinition:. The gateway refuses an entry without it.
  • The gateway does not support the di: and fx: blocks of the OPC UA Modeler. The gateway refuses an entry with one of these blocks. Set typeDefinition:.
  • An entry has exactly one parent reference. If an entry has more than one, or none, the gateway refuses it.
  • orderedComponentOf, physicalComponentOf and containedComponentOf make a HasOrderedComponent, HasPhysicalComponent or HasContainedComponent reference from the parent.
  • propertyOf is only for a Variable of the type ua:PropertyType. For another Variable, use componentOf or organizedBy.
  • 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​

  1. Add the NodeSet2.xml file of the type to imports:. Add the companion specifications that it uses, for example di, to namespaces:.
  2. Add an entry to instances:.
  3. Set browseName: to the name of the new Object.
  4. Set typeDefinition: to the type: t1:DistanceSensorType. t1 is the alias of the import.
  5. Set a parent reference to the browse path of the parent. To put the Object in the DeviceSet folder of DI, set organizedBy: /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​

  1. Add an entry to instances:.
  2. Set browseName: to the name of the Variable.
  3. Set dataType:, for example ua:Double.
  4. Do not set typeDefinition:.
  5. 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​

KeyRequiredMeaning
browseNameRequiredThe name of the node.
typeDefinitionRequired for an ObjectThe type of the Object, as alias:TypeName.
dataTypeRequired for a VariableThe data type of the Variable, as alias:TypeName.
organizedBy, componentOf, propertyOf, orderedComponentOf, physicalComponentOf, containedComponentOfOne of the sixThe browse path of the parent node.
optionalsOptionalThe optional members of the type to make.
nodeIdOptionalA string node id, for example s=MyMachine. Without it, the gateway chooses a number.
displayName, descriptionOptionalThe texts that an OPC UA client shows.
valueRank, arrayDimensions, accessLevel, historizing, minimumSamplingIntervalOptionalThe attributes of a Variable.

The reference of all keys is in instances.