--- alias: user-guide-data-platform-uns-connectivity tags: - data platform - UNS - MQTT - CDM summary: "Understand how Light CDM Events and the UNS Connector work together to publish real-time manufacturing events to an MQTT broker" --- # UNS Connectivity ## Overview The **Unified Namespace (UNS) Connectivity** feature enables the Critical Manufacturing MES to publish real-time Canonical Data Model (CDM) events to an MQTT broker, making shop-floor data instantly available to external systems, dashboards, and analytics platforms. UNS Connectivity builds on two core Data Platform capabilities: * **Light CDM Events** — a simplified variant of CDM events optimized for real-time performance, containing essential event properties without the overhead of the full event schema. * **UNS Connector** — a dedicated container that publishes Light CDM events to an MQTT broker using the Publish/Subscribe pattern. ```mermaid graph LR A[MES Operations] --> B[HouseKeeper CDM Builder Light] B --> C[Kafka] C --> D[UNS Connector] D --> E[MQTT Broker] E --> F[External Consumers] classDef mermaid_entity color:#000, fill:#FB9F53, stroke:#FB9F53, stroke-width:0px, font-size:100%; classDef mermaid_businessdata color:#000, fill:#65CDE8, stroke:#65CDE8, stroke-width:0px, font-size:100%; classDef mermaid_nonbusinessdata color:#000, fill:#B7DEE8, stroke:#B7DEE8, stroke-width:0px, font-size:100%; class A mermaid_entity class B,C,D mermaid_businessdata class E,F mermaid_nonbusinessdata ``` ## How It Works ### Event Generation When manufacturing activities occur in the MES — such as a resource state change, a material operation, or a data collection event — the **HouseKeeper CDM Builder Light** service generates Light CDM events. These events are: * **Standardized** — structured according to the ISA-95 hierarchy (Enterprise, Site, Area, Resource). * **Self-contained** — each event carries its full context, including current and previous states. * **Lightweight** — includes only essential properties for real-time efficiency. ### Event Publishing The **UNS Export Integration** business scenario creates an automation controller that: 1. **Subscribes** to configured Light CDM event types via IoT Event Definition bindings. 2. **Transforms** each event into an MQTT-compatible message with a hierarchical topic based on the ISA-95 manufacturing hierarchy. 3. **Publishes** the message to the configured MQTT broker. The resulting MQTT topic follows this pattern: ```log Enterprise/Site/Area/Resource/EventType ``` For example: `DefaultEnterprise/DefaultSite/Cookie-Manufacturing/Baker-01/ResourceStateChange` ## Light CDM Events Light CDM Events are specially designed for real-time scenarios. Not all CDM Event Definitions support the light variant. The following events have light variants enabled out of the box: {% include-markdown 'includes/pages/light_cdm_events_list.md' %} ### Viewing Available Light Events To see which events support light variants in your environment: 1. Navigate to **Data Platform** > **IoT Event Definition**. 2. Check the **Has Light Variant** column. Only events with this property enabled can be used with the UNS Export Integration. ### Light Event Properties The properties included in each light variant are documented in the [MES Canonical Event Definition](https://developer.criticalmanufacturing.com/reference/api-data-platform/docs/index.html). Light events balance efficiency with completeness, including: * **Header** — correlation ID, timestamps, CDM version. * **Hierarchy** — Enterprise, Site, Facility, and Area context. * **Entity data** — core properties of the affected entity (for example, Resource state, Material operation details). * **Previous state** — for state-change events, the prior entity state. ### Enriching Light Events If you need additional properties beyond the default set: 1. Navigate to **Administration** > **Entity Type**. 2. Select the relevant entity type. 3. In the **Properties** tab, select **Manage**. 4. Enable the **Is To Enrich CDM** toggle for the desired properties. 5. Select **Update**, then **Generate** on the top ribbon to regenerate the schema. !!! warning Changes to enrichment properties require schema regeneration. Events will not include new properties until this step is complete. ## Data Platform Workflows for UNS The UNS Export Integration creates a specialized **Data Platform Workflow** — an automation controller that processes Light CDM events and publishes them to MQTT. ### Viewing UNS Workflows To view the UNS automation controllers in your environment: 1. Navigate to **Data Platform** > **Data Platform Workflows**. 2. Look for controllers created through the `UNS Export Integration` business scenario. Each controller displays: | Property | Description | | --- | --- | | **Name** | The controller name provided during creation (for example, `Test-01 Controller`). | | **Type** | `General` | | **Scope** | `DataPlatform` | | **Status** | Active state — the controller is processing events when active. | ### Workflow Structure The UNS automation controller contains a single `Setup` workflow with three sequential tasks: 1. **Job Start** — triggers when a configured CDM event is received. Outputs the raw event data and IoT event metadata. 2. **Code Execution** — transforms the raw CDM event data into an MQTT topic string by extracting the ISA-95 hierarchy names and appending the event type. Spaces are replaced with hyphens for topic compatibility. 3. **Distributed Message Send** — sends the transformed data (topic + payload) to the `UnsExportIntegration.SendToMqtt` service, which publishes it to the MQTT broker. !!! info For generic information about automation controllers and workflows, see [[user-guide-automation-controller-index]]. ### IoT Event Definition Bindings Each UNS automation controller is bound to one or more IoT Event Definitions. These bindings determine which CDM event types the controller subscribes to and processes. To view the bindings: 1. Open the automation controller in **Data Platform** > **Data Platform Workflows**. 2. Review the associated IoT Event Definitions. Each binding specifies: * The **IoT Event Definition** name (for example, `ResourceStateChange`). * The **Supported Event Variant** (`Light`). ## Creating UNS Automation Controllers New UNS automation controllers are created through the **Cortex** chatbot using the `UNS Export Integration` business scenario: 1. Navigate to **Data Platform** and open the **Activity Center** > **Chatbot**. 2. Select the `UNS Export Integration` business scenario. 3. Follow the guided flow to name the controller and select IoT Event Definitions. 4. Load the generated Master Data Package. For detailed steps, see [[operation-guide-configuring-uns-export-integration]]. ## Relationship to Other Data Platform Features UNS Connectivity integrates with the broader Data Platform ecosystem: | Feature | Relationship | | --- | --- | | **CDM / Data Sets** | UNS events originate from the same CDM event pipeline used for analytics and reporting. | | **Data Platform Workflows** | UNS automation controllers are a specific type of Data Platform Workflow. | | **IoT Event Definitions** | UNS uses the same event definitions that support data ingestion and other Data Platform scenarios. | | **Analytics Views** | Historical CDM data feeds [[user-guide-analytics-view-index]]; UNS provides the real-time complement. | | **Machine Learning** | ML models can consume the same CDM events, enabling real-time predictions alongside UNS output. | ## Related Topics * [[user-guide-data-platform-workflows]] — general Data Platform Workflows documentation * [[user-guide-iot-event-definition-index]] — IoT Event Definition management * [[user-guide-automation-controller-index]] — general automation controller reference * [[tutorials-realtime-insights]] — tutorial for configuring UNS and verifying events * [[operation-guide-configuring-uns-export-integration]] — administration guide for UNS setup