building a Temperature Sensor
In this example, we are going to create interactively Temperature Sensor Device.
It will be based on the "Device Integration (DI)" companion specification.
DeviceType
# yaml-language-server: $schema=../schemas/nodeset2.schema.json
namespaceUri: http://acme.com/UA/TemperatureSensor
version: 1.0.0
publicationDate: 2019-01-01T00:00:00Z
namespaces:
- di
objectTypes:
- browseName: TemperatureSensor2Type
subtypeOf: di:DeviceType
description: |
The Temperature Sensor
### description
the temperature **sensor**
<img src="https://www.engineersgarage.com/wp-content/uploads/2019/10/lm35-pin-out_orig-1.png" />
components:
- browseName: di:ParameterSet
components:
- browseName: Temperature
typeDefinition: ua:AnalogItemType
dataType: ua:Double
engineeringUnits: "degree Celsius"
description: |
The actual temperature
- browseName: di:MethodSet
methods:
- browseName: Calibrate
nodeClass: Method
inputArguments:
- name: coefficentA
dataType: ua:Double
description: the B coefficient used to perform the linear interpolation `T = A*x + B`
- name: coefficentB
dataType: ua:Double
description: the B coefficient used to perform the linear interpolation `T = A*x + B`
outputArguments:
- name: previousCoefA
dataType: ua:Double
- name: previousCoefB
dataType: ua:Double
description: |
Initiate the calibration of the sensor.
The Calibrate method initiate the calibrationof the temperature sensor on the physical device.
This method takes two arguments that define the linear interpolation `T = A*x + B`.
instances:
- browseName: TemperatureSensor2
typeDefinition: TemperatureSensorType
organizedBy: /ua:Objects/di:DeviceSet
The Temperature Sensor
BrowseName: | 1:TemperatureSensor2Type |
Base | 2:DeviceType |
Description - | The Temperature Sensor |
ReferenceType | NodeId | BrowseName | ModellingRule | TypeDefinition | DataType | Value |
---|---|---|---|---|---|---|
HasComponent Ⓞ | ns=1;i=1008 | 2:ParameterSet | Mandatory | BaseObjectType | ||
2:ParameterSet | ||||||
HasComponent Ⓥ | ns=1;i=1009 | 2:ParameterSet.1:Temperature | Mandatory | AnalogItemType | Double | null |
HasComponent Ⓞ | ns=1;i=1012 | 2:MethodSet | Mandatory | BaseObjectType | ||
2:MethodSet | ||||||
HasComponent Ⓜ | ns=1;i=1013 | 2:MethodSet.1:Calibrate |