uns-sim — Machine Simulator
A configurable CNC machine simulator that publishes realistic data to MQTT.
| Language | Node.js |
| Type | MQTT publisher |
| Scaffolded with | fnkit node-mqtt |
| Depends on | MQTT broker |
What It Does
Simulates 4 CNC machines across 2 production areas, each publishing status, program, and tool data every 3 seconds.
Topics Published
v1.0/enterprise/site1/area1/cnc-01/status ...program ...tool v1.0/enterprise/site1/area1/cnc-02/status ...program ...tool v1.0/enterprise/site1/area2/cnc-03/status ...program ...tool v1.0/enterprise/site1/area2/cnc-04/status ...program ...tool
12 topics total — 4 machines x 3 data tags.
Machine States
| State | Description |
|---|---|
| ACTIVE | Running a program, spindle on |
| IDLE | Powered on, no program |
| WAITING | Waiting for operator/material |
| ALARM | Fault condition |
| SETUP | Tool change / program loading |
| OFFLINE | Machine powered down |
Simulated Machines
| Machine | Name | Area |
|---|---|---|
| cnc-01 | Haas VF-2 Mill | area1 |
| cnc-02 | DMG Mori NLX 2500 | area1 |
| cnc-03 | Mazak Integrex i-200 | area2 |
| cnc-04 | Okuma LB3000 EX II | area2 |
Quick Start
cd uns-sim && cp .env.example .env docker compose up -d && docker logs -f uns-sim
Replacing with Real Machines
In production, replace with OPC UA gateway, Sparkplug B, or a custom edge agent. The rest of the pipeline works identically.