AddIns
Introduction
AddIns in OPC UA are a way to extend the functionality of an OPC UA server by adding custom components. This page will guide you through creating AddIn ObjectTypes and their instances using the OPC UA Modeler. add the ability to create AddIn ObjectType
Creating AddIn ObjectTypes
An AddIn ObjectType must have a 0:DefaultInstanceBrowseName
property that specifies the BrowseName of the default instance of the AddIn. For simplicity, we have added a defaultInstanceBrowseName
property in the YAML configuration.
Example
objectTypes:
- browseName: MyComponentType
defaultInstanceBrowseName: MyComponent
This is equvalent to
objectTypes:
- browseName: MyComponentType
properties:
- name: ua:DefaultInstanceBrowseName
type: QualifiedName
value: MyComponent
Creating Instances of AddIn ObjectTypes
Once an AddIn Object Type has been created, you can create an instance of it by using the AddIns
property
Example
instances:
- browseName: MyDevice
type: di:DeviceType
addIns:
-typeDefinition: MyComponentType
By default, the AddIns
instance name will be the same as the value stored in the defaultInstanceBrowseName
property of the AddIn ObjectType.
Specifying Different Names for AddIn Instances
If you want to specify a different name for the AddIn instance or add multiple instances of the same component inside your object or object type, you can do so by using the browseName property
instances:
- browseName: MyDevice
type: di:DeviceType
addIns:
-typeDefinition: MyComponentType
-typeDefinition: MyComponentType
browseName: MyComponent1
-typeDefinition: MyComponentType
browseName: MyComponent2
Instantiating AddIn Inside an ObjectType Declaration
You can also instantiate AddIn inside an ObjectType declaration in the same way. When doing this, you can add the modellingRule property to specify whether the AddIn is optional or mandatory.
example:
objectTypes:
- browseName: MyDeviceType
addIns:
- typeDefinition: MyComponentType
browseName: MyComponent1
modellingRule: Mandatory
- typeDefinition: MyComponentType
browseName: MyComponent2
modellingRule: Optional
In this example, MyComponentType is instantiated inside MyDeviceType. The modellingRule property is used to specify whether each AddIn is optional or mandatory.