Skip to content

Commit 5fd6533

Browse files
Add UNS docs (#15)
Co-authored-by: Alex Godbehere <114239316+AlexGodbehere@users.noreply.github.com> Co-authored-by: Alex Godbehere <alex.godbehere@gmail.com>
1 parent 1553af4 commit 5fd6533

2 files changed

Lines changed: 109 additions & 3 deletions

File tree

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
sidebar_position: 12
3+
---
4+
5+
import {CentralCluster} from "../../../src/components/Clusters";
6+
import {OpenSourceExample} from "../../../src/components/OpenSourceExample";
7+
8+
# UNS
9+
10+
The UNS (Unified Namespace) is the human-readable "single source of truth" for real-time communication between
11+
non-industrial IoT (IIoT) Factory+ data producers and consumers.
12+
13+
<OpenSourceExample buttonText={'ACS UNS Component'}
14+
repoUrl={'https://github.com/AMRC-FactoryPlus/amrc-connectivity-stack/tree/main/uns-ingester-sparkplug'}>
15+
</OpenSourceExample>
16+
17+
## Overview
18+
19+
<CentralCluster hilite="UNS"/>
20+
21+
The UNS is one of two namespaces that Factory+ components use for publishing and subscribing. The Sparkplug namespace facilitates data
22+
collection in levels 1 and 2 of the [ISA-95 functional model](https://www.isa.org/intech-home/2021/october-2021/features/beyond-the-pyramid-using-isa95-for-industry-4-0-an),
23+
while the UNS serves as a means of communication for components at levels 3 and above (MES and ERP systems). Data from
24+
the edge is published to the Sparkplug namespace and then republished to the UNS by the UNS Ingester component, complying
25+
with the UNS topic and data structure specification.
26+
27+
### Schema
28+
The ISA-95 hierarchy for a device is defined by the [Device Information Schema](https://github.com/AMRC-FactoryPlus/schemas/blob/main/Common/Device_Information-v1.json)
29+
under `"ISA95_Hierarchy"` published on `DBRITH`.
30+
* The ISA-95 hierarchy **MUST** be populated for the Sparkplug UNS Ingester to republish packets to the UNS.
31+
32+
### Topic Structure
33+
The UNS Topic structure must follow the standard: `<ISA-95>/<Source>/<SchemaPath>`.
34+
35+
* All topics **MUST** be prefixed with the ISA-95 hierarchy.
36+
37+
| Name | Optional |
38+
|--------------|----------|
39+
| `Enterprise` | No |
40+
| `Site` | Yes |
41+
| `Area` | Yes |
42+
| `Work Centre`| Yes |
43+
| `Work Unit` | Yes |
44+
45+
* Topics **MUST** specify their source (Edge, MES, etc.).
46+
* Topics **MUST** contain the schema path to the value being published.
47+
48+
**Example:** `CompanyA/SiteB/Machining/Edge/Power/Voltage`
49+
50+
### Packet Structure
51+
52+
:::caution MQTT Version
53+
The MQTT broker **MUST** support MQTTv5 to enable custom properties defined in the payload specification.
54+
:::
55+
56+
#### Payload
57+
The UNS packet structure consists of the latest value and timestamp. The structure also supports
58+
batched metrics, with the "Batch" property containing an array of values and timestamps.
59+
60+
| Property | Type | Description |
61+
|------------|--------|----------------------------------------------------|
62+
| `Value` | string | The value to publish |
63+
| `Timestamp`| string | The timestamp of the value at source |
64+
| `Batch` | array | Array of values and timestamps to publish |
65+
66+
#### Custom Properties
67+
The packet utilises MQTTv5 custom properties to send metadata relating to the value. These values are parsed from the
68+
Sparkplug payload when republishing to the UNS.
69+
70+
| Property | Type | Description |
71+
|--------------------|---------|------------------------------------------------|
72+
| `InstanceUUIDPath` | UUID | The full instance UUID path of the device |
73+
| `InstanceUUID` | UUID | The top level instance UUID of the device |
74+
| `SchemaUUIDPath` | string | The full schema UUID path the value relates to |
75+
| `SchemaUUID` | UUID | The top-level UUID of the utilised schema |
76+
| `Type` | string | The Sparkplug type of the value |
77+
| `Unit` | string | The measurement unit of the value |
78+
| `Transient` | boolean | Record the value to the historian |
79+
80+
### Permissions
81+
82+
#### Global
83+
84+
<Permission type='Permission' name='Write to entire UNS'
85+
description='Write to all topics for the whole UNS'
86+
uuid='9fa6ff20-9d2a-4444-960c-40ebcf56f5b4'/>
87+
88+
```json
89+
{
90+
"UNS/v1/#": "w"
91+
}
92+
```
93+
94+
---
95+
96+
<Permission type='Permission' name='Read entire UNS'
97+
description='Subscribe to and read all topics for the whole UNS'
98+
uuid='ffa40b36-3a61-4545-832a-2d1e8b860d63'/>
99+
100+
```json
101+
{
102+
"UNS/v1/#": "rs"
103+
}
104+
```

src/components/Clusters.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,19 @@ export function CentralCluster (props) {
7575
<FpCpt name="authorisation" style="mid" vertical justify="end"
7676
layout="flex-1 mt-2 ml-2 w-[3vw]">Authorisation</FpCpt>
7777
</div>
78-
<div className="grid grid-cols-4 gap-2">
78+
<div className="grid grid-cols-5 gap-2">
7979
<FpCpt name="identity" style="dark" justify="end" layout="col-span-full h-[3vw]">Identity</FpCpt>
8080
<FpCpt name="authorisation" style="mid" justify="end" layout="col-span-full h-[3vw]">Authorisation</FpCpt>
8181
<FpCpt name="directory" layout="ml-2">Directory</FpCpt>
8282
<FpCpt name="configuration-store">Config Store</FpCpt>
8383
<FpCpt name="commands">Commands</FpCpt>
8484
<FpCpt name="git">Git Server</FpCpt>
85-
<FpCpt name="manager" layout="ml-2">Manager</FpCpt>
86-
<FpCpt name="data-warehouse">Data Warehouse</FpCpt>
85+
<FpCpt name="manager">Manager</FpCpt>
86+
<FpCpt name="data-warehouse" layout="ml-2">Data Warehouse</FpCpt>
8787
<FpCpt name="cluster-manager">Cluster Manager</FpCpt>
8888
<FpCpt name="monitor">Central Monitor</FpCpt>
89+
<FpCpt name="UNS">UNS</FpCpt>
90+
<FpCpt name=""></FpCpt>
8991
<FpCpt name="mqtt" layout="col-span-full ml-2">MQTT</FpCpt>
9092
</div>
9193
</Cluster>;

0 commit comments

Comments
 (0)