Product · SPX in practice

From one device to a connected system.

Connect your software to virtual devices, model control loops and build connected systems. Work in the UI, with AI agents or in code.

SPX Connections page showing seven active attribute connections between weather_station, building_physics, rooftop_pv, smart_plug and battery_grid.
Connected building: weather, HVAC, rooftop PV, loads and battery/grid.

Screenshot preview

Connected building: weather, HVAC, rooftop PV, loads and battery/grid. Open original image

01 · Simulate a device

A virtual device. Your real software.

Run an energy meter model locally in SPX. Connect your client over Modbus TCP, change the simulated load and check the measurements your software receives.

How the connection works

Example configuration · Modbus TCP

Your side

Your software or device

Application, controller or gateway acting as a Modbus client.

Modbus TCP

Read registers

Live measurements

Your local machine

SPX runtime

Modbus TCP server

Register mapping

Library model

iEM3000 energy meter

Measurements, state and behavior

Control the model via UI, AI agent or code

Your client can run on the same machine or connect over your network. SPX maps protocol requests to the running model.

02 · Model a controller and process

Close the loop before hardware arrives.

Connect controller logic to a virtual process and feed the measured response back. Change a setpoint or disturbance and inspect how the loop reacts.

A controller, a process and feedback

Example configuration · Thermal control

Your local simulation

SPX runtime

Controller logic

PID controller

Setpoint, gains and control output

Heating output

Process model

Heater and thermal process

Heating input and temperature response

Temperature

Measurement

Temperature feedback

Observed process temperature

Measured temperature returns to the controller input

Connect controller output to the process input, then return the measured response to close the loop. These blocks represent modeled behavior and attribute connections.

03 · Build a connected system

Make models work together.

Link selected attributes between running models. In a building simulation, outdoor conditions affect HVAC behavior, and its electrical load feeds an energy meter model.

One system, connected models

Example configuration · Connected building

Your connected simulation

SPX runtime

Weather model

Outdoor conditions

Temperature and changing weather inputs

MQTT

Outdoor temperature

HVAC model

Building climate

Heating, cooling and power demand

BACnet/IP

Electrical load

Meter model

Energy measurements

Current, power and consumption

Modbus TCP

Arrows show configured SPX attribute connections. Protocol badges identify the models' communication interfaces.

04 · Build a protocol gateway

Build a protocol gateway. Verify it with real clients.

Read a measurement over Modbus TCP, map it to a named attribute in SPX, and publish it to MQTT. Change the simulated reading and verify what your subscriber receives before connecting field hardware.

From a Modbus register to an MQTT subscriber

Example configuration · Modbus TCP → MQTT

Source

Simulated energy meter

Exposes a live frequency reading in its input registers.

Modbus TCP

Register value

Gateway instance

SPX runtime

Mapping

Protocol gateway

Polls the meter, decodes the register value, and publishes the frequency_hz attribute as a JSON number.

Publish

Message delivery

MQTT broker

Receives the reading on the configured topic.

MQTT

Deliver

Your client

MQTT subscriber

Reads the new value from the same topic.

In the walkthrough, the reading changed from 50.0 Hz to 49.25 Hz in both the SPX gateway and the MQTT subscriber.

05 · Combine real and virtual components

Keep your hardware. Extend its environment.

Keep real equipment connected to your controller or BMS. Add a virtual HVAC unit through BACnet/IP to test its interaction with the rest of your setup.

Real equipment meets virtual devices

Example configuration · Mixed building setup

Your real environment

Real controller

Real controller

Your controller or BMS

Your actual control logic and BACnet client

Existing hardware I/O

Real sensors and actuators

Keep the physical devices you already use

BACnet/IP

Commands and reads

Device state and values

Your SPX machine

SPX runtime

Virtual device

HVAC unit

BACnet endpoint, state and simulated behavior

Your controller keeps its real I/O. SPX supplies the virtual device through its protocol endpoint on the reachable SPX host.

06 · Automate tests and CI workflows

Turn a simulation into a regression test.

Use Python tests to create model instances, apply inputs and check expected behavior. Run the same checks locally or in your CI pipeline, then clean up the test instances.

From test code to a CI result

Example configuration · Python regression test

Your local or CI runner

Your test suite

Test code

Python test

Create an instance and apply test inputs

Check results

Assertions

Expected vs. observed

Report the outcome to your test runner

SPX Python client

Create, run and change

Read state and values

SPX test environment

SPX runtime

Model under test

Virtual device or system

Controlled inputs, scenarios and live state

Use the SPX Python client for lifecycle and state checks. Add a protocol client when the test also needs to verify communication behavior.