|
| 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 | +``` |
0 commit comments