OP10-CNC Rough Machining
The first station in the production line performs rough machining operations on raw aluminum castings. This 5-axis CNC removes bulk material and creates the primary geometry of the brake caliper housing. Use Modbus TCP to read real-time machine state, production counters, sensor data, and fault information.
localhost:5020
Unit ID:
1
Update Rate:
50ms (20 Hz)
Business Purpose
Why Connect to This Simulator?
OEE Monitoring: Read production counters (good/bad parts) and machine states to calculate availability, performance, and quality metrics.
Predictive Maintenance: Monitor spindle load, vibration, and temperature sensors to detect wear patterns before failures occur.
Energy Management: Track power consumption per part for energy cost allocation and efficiency optimization.
Downtime Analysis: Capture fault codes and state transitions to build Pareto charts of downtime causes.
Station Specifications
Modbus Register Map
All registers are holding registers (function code 03). Addresses follow Modbus convention (40001 = register 0).
| Address | Name | Type | Description |
|---|---|---|---|
40001 | State | uint16 | 0=OFF, 1=IDLE, 2=RUNNING, 3=FAULTED, 4=BLOCKED, 5=STARVED |
40002 | Step | uint16 | 0=IDLE, 1=LOADING, 2=PROCESSING, 3=UNLOADING |
40005 | PartsProduced | uint16 | Cumulative parts count |
40006 | PartsGood | uint16 | Good parts count |
40007 | PartsBad | uint16 | Bad parts (scrap + rework) |
40008 | FaultActive | uint16 | 0=No fault, 1=Fault active |
40009 | FaultCode | uint16 | 1001=Spindle Overload, 1002=Tool Break, 1003=Coolant Low |
40010 | SpindleSpeed | uint16 | RPM (0-12000) |
40011 | SpindleLoad | uint16 | Load % x10 (45.2% = 452) |
40015 | Vibration | uint16 | mm/s x1000 (0.5 = 500) |
40016 | Temperature | uint16 | Celsius x10 (35.2 = 352) |
40022 | PowerKW | uint16 | kW x100 (15.5 = 1550) |
40110-11 | RunTime | uint32 | Accumulated run time (seconds) |
40112-13 | DownTime | uint32 | Accumulated down time (seconds) |
OP30-WASH Parts Washer
The parts washer uses high-pressure aqueous cleaning to remove machining chips, coolant residue, and contaminants from the brake caliper housing. Clean parts are essential for accurate leak testing at the next station. Monitor wash temperature, pressure, and filter status to ensure cleaning quality.
localhost:5021
Unit ID:
1
Update Rate:
50ms (20 Hz)
Business Purpose
Why Connect to This Simulator?
Quality Correlation: Monitor wash temperature and pressure to correlate cleaning parameters with downstream leak test results.
Maintenance Scheduling: Track filter pressure differential to schedule filter replacements before clogging causes downtime.
Process Optimization: Analyze cycle times and temperature profiles to optimize cleaning without affecting quality.
Environmental Compliance: Log water usage and chemical consumption for sustainability reporting.
Station Specifications
Modbus Register Map
| Address | Name | Type | Description |
|---|---|---|---|
40001 | State | uint16 | 0=OFF, 1=IDLE, 2=RUNNING, 3=FAULTED, 4=BLOCKED, 5=STARVED |
40002 | Step | uint16 | 0=IDLE, 1=LOADING, 2=WASHING, 3=UNLOADING |
40005 | PartsProduced | uint16 | Cumulative parts washed |
40006 | PartsGood | uint16 | Successfully cleaned parts |
40007 | PartsBad | uint16 | Parts requiring re-wash |
40008 | FaultActive | uint16 | 0=No fault, 1=Fault active |
40009 | FaultCode | uint16 | 3001=Temp Low, 3002=Filter Clogged |
40013 | WashPressure | uint16 | bar x10 (6.5 = 65) |
40014 | WashTemp | uint16 | Celsius x10 (55.0 = 550) |
40022 | PowerKW | uint16 | kW x100 |
OP20-CNC Finish Machining
The finish machining station performs precision operations to achieve final dimensions and surface quality. This station is critical for bore tolerances and thread quality. OPC UA provides a rich, hierarchical data structure with strong typing and metadata for enterprise integration.
opc.tcp://localhost:4840
Security:
None (Anonymous)
Business Purpose
Why Connect to This Simulator?
Precision Monitoring: Track bore diameter measurements and surface finish parameters for SPC analysis.
Tool Life Management: Monitor tool wear counters to optimize tool change intervals and reduce scrap from worn tools.
Traceability: Capture part serial numbers with timestamps for full genealogy tracking through the production line.
Enterprise Integration: OPC UA's standardized information model enables seamless connection to MES and ERP systems.
Station Specifications
OPC UA Node Structure
Nodes are organized under namespace index 1. Browse from ns=1;s=OP20-CNC
| Node ID | Type | Description |
|---|---|---|
ns=1;s=OP20-CNC.State | String | IDLE, RUNNING, FAULTED, BLOCKED, STARVED |
ns=1;s=OP20-CNC.Step | String | IDLE, LOADING, PROCESSING, UNLOADING |
ns=1;s=OP20-CNC.CurrentPart | String | Serial number of part being processed |
ns=1;s=OP20-CNC.PartsProduced | Int32 | Total parts completed |
ns=1;s=OP20-CNC.PartsGood | Int32 | Good parts count |
ns=1;s=OP20-CNC.PartsBad | Int32 | Scrap + rework count |
ns=1;s=OP20-CNC.SpindleSpeed | Float | Current spindle RPM |
ns=1;s=OP20-CNC.SpindleLoad | Float | Spindle load percentage |
ns=1;s=OP20-CNC.FeedRate | Float | Current feed rate (mm/min) |
ns=1;s=OP20-CNC.CoolantPressure | Float | Coolant pressure (bar) |
ns=1;s=OP20-CNC.CoolantTemp | Float | Coolant temperature (Celsius) |
ns=1;s=OP20-CNC.Vibration | Float | Vibration level (mm/s) |
ns=1;s=OP20-CNC.Temperature | Float | Machine temperature (Celsius) |
ns=1;s=OP20-CNC.Voltage | Float | Supply voltage (V) |
ns=1;s=OP20-CNC.Current | Float | Current draw (A) |
ns=1;s=OP20-CNC.Power | Float | Current power consumption (kW) |
ns=1;s=OP20-CNC.PowerFactor | Float | Power factor |
ns=1;s=OP20-CNC.EnergyKWH | Float | Cumulative energy (kWh) |
ns=1;s=OP20-CNC.ToolID | String | Current tool identifier |
ns=1;s=OP20-CNC.ToolName | String | Current tool name |
ns=1;s=OP20-CNC.ToolLifeCount | Int32 | Current tool usage count |
ns=1;s=OP20-CNC.ToolLifeLimit | Int32 | Tool life limit |
ns=1;s=OP20-CNC.ToolLifeRemaining | Int32 | Remaining tool life |
ns=1;s=OP20-CNC.FaultActive | Boolean | True if fault is active |
ns=1;s=OP20-CNC.FaultCode | String | E2001=Bore OOS, E2002=Tap Break |
ns=1;s=OP20-CNC.FaultName | String | Fault description |
ns=1;s=OP20-CNC.RunTimeSec | Float | Accumulated run time |
ns=1;s=OP20-CNC.DownTimeSec | Float | Accumulated down time |
ns=1;s=OP20-CNC.IdleTimeSec | Float | Accumulated idle time |
OP40-TEST Leak Test
The final quality gate uses pressure decay testing to verify hydraulic integrity of the brake caliper. Parts are pressurized and held while monitoring for pressure drop. This station determines if parts pass to finished goods or are rejected. Critical for safety-related automotive components.
opc.tcp://localhost:4841
Security:
None (Anonymous)
Business Purpose
Why Connect to This Simulator?
Quality Assurance: Every part's leak test result determines final pass/fail status - essential for quality KPIs.
Defect Root Cause: Correlate leak failures with upstream machining parameters to identify process issues.
Compliance Documentation: Automotive safety regulations require traceable test records for every brake component.
Yield Analysis: Monitor first-pass yield trends to detect quality drift before it impacts production targets.
Station Specifications
OPC UA Node Structure
Nodes are organized under namespace index 1. Browse from ns=1;s=OP40-TEST. Test-specific sensors provide leak rate and pressure decay measurements.
| Node ID | Type | Description |
|---|---|---|
ns=1;s=OP40-TEST.State | String | Machine state |
ns=1;s=OP40-TEST.Step | String | IDLE, LOADING, PROCESSING, UNLOADING |
ns=1;s=OP40-TEST.CurrentPart | String | Part serial number under test |
ns=1;s=OP40-TEST.PartsProduced | Int32 | Total parts tested |
ns=1;s=OP40-TEST.PartsGood | Int32 | Parts passed leak test |
ns=1;s=OP40-TEST.PartsBad | Int32 | Parts failed leak test |
ns=1;s=OP40-TEST.TestPressure | Float | Current test pressure (bar) |
ns=1;s=OP40-TEST.LeakRate | Float | Measured leak rate (cc/min) |
ns=1;s=OP40-TEST.PressureDecay | Float | Pressure drop during test (mbar) |
ns=1;s=OP40-TEST.Temperature | Float | Machine temperature (Celsius) |
ns=1;s=OP40-TEST.Voltage | Float | Supply voltage (V) |
ns=1;s=OP40-TEST.Current | Float | Current draw (A) |
ns=1;s=OP40-TEST.Power | Float | Current power consumption (kW) |
ns=1;s=OP40-TEST.PowerFactor | Float | Power factor |
ns=1;s=OP40-TEST.EnergyKWH | Float | Cumulative energy (kWh) |
ns=1;s=OP40-TEST.FaultActive | Boolean | Fault status |
ns=1;s=OP40-TEST.FaultCode | String | E4001=Air Pressure Low, E4002=Seal Wear |
ns=1;s=OP40-TEST.FaultName | String | Fault description |
ns=1;s=OP40-TEST.RunTimeSec | Float | Accumulated run time |
ns=1;s=OP40-TEST.DownTimeSec | Float | Accumulated down time |
ns=1;s=OP40-TEST.IdleTimeSec | Float | Accumulated idle time |
MES REST API
The MES API provides production execution and shop floor control capabilities. Manage work orders, track production records with full part traceability, monitor quality measurements, record downtime events, and access real-time equipment status. All data is JSON-formatted for easy integration.
http://localhost:8080/api/v1
Business Purpose
Why Connect to This Simulator?
Analytics Platform Integration: Structured JSON responses designed for BI tools and data warehouses.
OEE Calculation: Production counters, downtime events, and quality records provide all inputs for OEE metrics.
Part Traceability: Every part's complete production history including cycle times, measurements, and tool usage.
Master Data Sync: Equipment definitions, product routings, and reason codes for maintaining data consistency.
Available Endpoints
Master Data
Work Orders
Production Data
Quality & Downtime
Real-Time Status
ERP REST API
The ERP API provides business-level data for inventory management and stock movements. Use this API to simulate material replenishment, finished goods shipping, and inventory tracking operations that typically come from enterprise resource planning systems.
http://localhost:8081/api/v1
Business Purpose
Why Connect to This Simulator?
Inventory Visibility: Real-time stock levels for raw materials, WIP, and finished goods.
Material Flow: Track stock movements from receiving through production to shipping.
Automation Control: Configure automatic material replenishment and shipping rules.
Available Endpoints
Inventory
Automation & Movements
MQTT Event Broker
An embedded MQTT broker that publishes real-time factory events. Subscribe to topics to receive station state changes, cycle events, faults, work order updates, quality data, and periodic status updates. Connect any MQTT client (mosquitto_sub, MQTT Explorer, Node-RED) to stream events.
mqtt://localhost:1883
Topic Structure
All topics use the format factory/LINE-BC-01/... where LINE-BC-01 is the production line ID.
To receive all events, subscribe to: factory/LINE-BC-01/#
Event Stream Topics
Aggregated event streams - subscribe to these for all events of a type
| Topic | Event Type | Description |
|---|---|---|
factory/LINE-BC-01/events/state_change |
STATION_STATE_CHANGE | All station state transitions |
factory/LINE-BC-01/events/cycle |
CYCLE_START, CYCLE_COMPLETE | All cycle events from all stations |
factory/LINE-BC-01/events/production |
PART_COMPLETED | Parts finished (GOOD/SCRAP/REWORK) |
factory/LINE-BC-01/events/faults |
FAULT_TRIGGERED, FAULT_CLEARED | All fault events from all stations |
factory/LINE-BC-01/events/work_orders |
WORK_ORDER_STARTED, WORK_ORDER_COMPLETED | Work order lifecycle events |
Equipment Topics (per station)
Station-specific events. Stations: OP10-CNC, OP20-CNC, OP30-WASH, OP40-TEST
| Topic | Event Type | Description |
|---|---|---|
factory/LINE-BC-01/equipment/{station}/state |
STATION_STATE_CHANGE | State change (IDLE, RUNNING, FAULTED, etc.) |
factory/LINE-BC-01/equipment/{station}/cycle/start |
CYCLE_START | Part started processing at station |
factory/LINE-BC-01/equipment/{station}/cycle/complete |
CYCLE_COMPLETE | Part finished with measurements & process data |
factory/LINE-BC-01/equipment/{station}/fault |
FAULT_TRIGGERED | Fault occurred at station |
factory/LINE-BC-01/equipment/{station}/fault/cleared |
FAULT_CLEARED | Fault resolved at station |
Parts & Work Orders Topics
| Topic | Event Type | Description |
|---|---|---|
factory/LINE-BC-01/parts/completed |
PART_COMPLETED | Part finished all operations |
factory/LINE-BC-01/work_orders/started |
WORK_ORDER_STARTED | Work order started production |
factory/LINE-BC-01/work_orders/completed |
WORK_ORDER_COMPLETED | Work order finished |
Quality & Alerts Topics
| Topic | Event Type | Description |
|---|---|---|
factory/LINE-BC-01/quality/defects |
DEFECT_DETECTED | Quality defect with root cause |
factory/LINE-BC-01/alerts/fault |
FAULT_TRIGGERED | Critical fault alerts |
factory/LINE-BC-01/simulation/profile |
PROFILE_CHANGE | Simulation profile changed |
Periodic Status Topics (every 5 seconds)
| Topic | Event Type | Description |
|---|---|---|
factory/LINE-BC-01/status/production |
LINE_STATUS | Production line summary (counts, PPH) |
factory/LINE-BC-01/status/equipment/{station} |
EQUIPMENT_STATUS | Station state, counters, energy, faults |
factory/LINE-BC-01/status/buffers/{buffer} |
BUFFER_STATUS | Buffer level and capacity |
factory/LINE-BC-01/status/work_order |
WORK_ORDER_STATUS | Current work order progress |
Stations: OP10-CNC, OP20-CNC, OP30-WASH, OP40-TEST
Buffers: buffer-raw, buffer-1, buffer-2, buffer-3, buffer-finished
Example Payloads
CYCLE_COMPLETE Event
{
"event_type": "CYCLE_COMPLETE",
"station_id": "OP10-CNC",
"part_serial": "SN-000042",
"cycle_time_sec": 52.3,
"result": "GOOD",
"tool_used": "T1-FACE-MILL",
"tool_life_at": 245,
"energy_kwh": 0.42,
"measurements": [...],
"process_data": {
"spindle_speed_rpm": 3500,
"spindle_load_percent": 45.2,
"feed_rate_mm": 250
},
"timestamp": "2024-01-15T10:30:52Z"
}
FAULT_TRIGGERED Event
{
"event_type": "FAULT_TRIGGERED",
"station_id": "OP10-CNC",
"fault_id": "FLT-12345",
"fault_code": "E1001",
"fault_name": "Spindle Overload",
"description": "Spindle motor current exceeded threshold",
"severity": "major",
"start_time": "2024-01-15T10:25:30Z",
"timestamp": "2024-01-15T10:25:30Z"
}
LINE_STATUS Event (Periodic)
{
"event_type": "LINE_STATUS",
"total_produced": 1250,
"good_count": 1220,
"scrap_count": 20,
"rework_count": 10,
"parts_per_hour": 42.5,
"timestamp": "2024-01-15T10:35:00Z"
}
EQUIPMENT_STATUS Event (Periodic)
{
"event_type": "EQUIPMENT_STATUS",
"station_id": "OP10-CNC",
"state": "RUNNING",
"step": "PROCESSING",
"current_part": "SN-000042",
"parts_produced": 125,
"parts_good": 120,
"parts_bad": 5,
"run_time_sec": 3600.5,
"down_time_sec": 120.0,
"idle_time_sec": 280.3,
"fault_active": false,
"power_kw": 8.5,
"energy_kwh": 42.3,
"timestamp": "2024-01-15T10:35:00Z"
}
BUFFER_STATUS Event (Periodic)
{
"event_type": "BUFFER_STATUS",
"buffer_id": "buffer-raw",
"name": "Raw Material Buffer",
"current_level": 85,
"capacity": 100,
"timestamp": "2024-01-15T10:35:00Z"
}
WORK_ORDER_STATUS Event (Periodic)
{
"event_type": "WORK_ORDER_STATUS",
"order_id": "WO-2024-001",
"product_id": "BC-2024-A",
"target_qty": 100,
"produced_qty": 85,
"good_qty": 82,
"scrap_qty": 2,
"rework_qty": 1,
"status": "in_progress",
"timestamp": "2024-01-15T10:35:00Z"
}
Quick Start
Test the MQTT broker with any MQTT client:
Using mosquitto_sub
# Subscribe to all factory events mosquitto_sub -h localhost -p 1883 -t "factory/LINE-BC-01/#" -v # Subscribe to fault events only mosquitto_sub -h localhost -p 1883 -t "factory/LINE-BC-01/events/faults" -v # Subscribe to specific station mosquitto_sub -h localhost -p 1883 -t "factory/LINE-BC-01/equipment/OP10-CNC/#" -v
Using Node.js
const mqtt = require('mqtt');
const client = mqtt.connect('mqtt://localhost:1883');
client.on('connect', () => {
client.subscribe('factory/LINE-BC-01/#');
});
client.on('message', (topic, message) => {
const event = JSON.parse(message.toString());
console.log(topic, event);
});
PostgreSQL Factory Database
An embedded PostgreSQL database containing factory master data. Query employee information, shift schedules, equipment records, maintenance schedules, suppliers, materials, and product specifications. Connect any PostgreSQL client (psql, DBeaver, pgAdmin) to explore the data.
postgres://factory:factory123@localhost:5432/factory
Connection Details
| Parameter | Value |
|---|---|
| Host | localhost |
| Port | 5432 |
| Database | factory |
| Username | factory |
| Password | factory123 |
Database Schema
The factory database contains 15 tables organized into logical groups:
Organization & Personnel
| Table | Description | Key Columns |
|---|---|---|
departments |
Factory departments | id, name, code, manager_id |
employees |
Employee records | id, employee_id, first_name, last_name, email, department_id, role, hire_date |
shifts |
Shift definitions | id, name, start_time, end_time, days_of_week |
shift_assignments |
Employee shift assignments | id, employee_id, shift_id, start_date, end_date |
skills |
Skills catalog | id, name, category, description |
employee_skills |
Employee certifications | employee_id, skill_id, proficiency_level, certified_date |
Equipment & Maintenance
| Table | Description | Key Columns |
|---|---|---|
equipment |
Factory equipment/machines | id, equipment_id, name, type, manufacturer, model, serial_number, station_id |
maintenance_schedules |
Planned maintenance | id, equipment_id, maintenance_type, frequency_days, last_performed, next_due |
maintenance_records |
Maintenance history | id, equipment_id, maintenance_type, performed_by, performed_at, notes, parts_replaced |
Supply Chain
| Table | Description | Key Columns |
|---|---|---|
suppliers |
Material suppliers | id, name, code, contact_name, email, phone, address, rating |
materials |
Raw materials inventory | id, material_id, name, category, unit, supplier_id, lead_time_days, min_stock |
customers |
Customer records | id, name, code, contact_name, email, phone, address |
Products & Quality
| Table | Description | Key Columns |
|---|---|---|
products |
Product catalog | id, product_id, name, description, customer_id, cycle_time_sec, weight_kg |
bom_items |
Bill of materials | id, product_id, material_id, quantity, unit |
quality_specs |
Quality specifications | id, product_id, parameter, min_value, max_value, unit, station_id |
Sample Queries
List All Employees with Department
SELECT e.employee_id, e.first_name, e.last_name, e.role, d.name as department FROM employees e JOIN departments d ON e.department_id = d.id ORDER BY d.name, e.last_name;
Current Shift Assignments
SELECT e.first_name, e.last_name, s.name as shift,
s.start_time, s.end_time, sa.start_date
FROM shift_assignments sa
JOIN employees e ON sa.employee_id = e.id
JOIN shifts s ON sa.shift_id = s.id
WHERE sa.end_date IS NULL
ORDER BY s.name;
Equipment Maintenance Due
SELECT eq.equipment_id, eq.name, ms.maintenance_type,
ms.next_due, ms.frequency_days
FROM maintenance_schedules ms
JOIN equipment eq ON ms.equipment_id = eq.id
WHERE ms.next_due <= CURRENT_DATE + INTERVAL '7 days'
ORDER BY ms.next_due;
Employee Skills Matrix
SELECT e.first_name, e.last_name, sk.name as skill,
es.proficiency_level, es.certified_date
FROM employee_skills es
JOIN employees e ON es.employee_id = e.id
JOIN skills sk ON es.skill_id = sk.id
ORDER BY e.last_name, sk.category;
Product Bill of Materials
SELECT p.product_id, p.name as product, m.name as material,
b.quantity, b.unit, s.name as supplier
FROM bom_items b
JOIN products p ON b.product_id = p.id
JOIN materials m ON b.material_id = m.id
JOIN suppliers s ON m.supplier_id = s.id
ORDER BY p.name, m.name;
Quick Start
Connect to the database using any PostgreSQL client:
Using psql
# Connect to the factory database psql -h localhost -p 5432 -U factory -d factory # List all tables \dt # Describe a table \d employees # Run a query SELECT * FROM employees LIMIT 5;
Using Python
import psycopg2
conn = psycopg2.connect(
host="localhost",
port=5432,
database="factory",
user="factory",
password="factory123"
)
cur = conn.cursor()
cur.execute("SELECT * FROM employees")
for row in cur.fetchall():
print(row)
conn.close()
Using Node.js
const { Pool } = require('pg');
const pool = new Pool({
host: 'localhost',
port: 5432,
database: 'factory',
user: 'factory',
password: 'factory123'
});
pool.query('SELECT * FROM employees', (err, res) => {
console.log(res.rows);
pool.end();
});