Built-in test forcing · Hardware-in-the-Loop

Force every input. Check every output. On the real controller.

A first in the micro-PLC world: the EQSP32 has scriptable test forcing built in. Over one USB cable you inject any sensor value and read back every output, while your program runs on the actual controller. Every state, fault and timer is exercised before the plant is wired.

Run the tests by hand, from a script, or hand the whole job to an AI agent. Either way, the hardware decides what passes.

Tested on the controller that ships, not in a simulation.

Video thumbnail: an EQSP32 controller connected by USB to a laptop running a Hardware-in-the-Loop test session
Watch
3:46

You already know forcing. This is forcing, automated.

Every PLC programmer has forced an input from a laptop to see how the logic reacts. The EQSP32 takes that idea to its conclusion: every input can be forced over USB and every output read back, by command, so a whole test sequence can be written down once and replayed on demand. Think of it as a FAT (Factory Acceptance Test) procedure that runs itself: step, forced value, expected result, actual result, pass or fail.

The control logic is not modified and does not know it is under test. The same program runs on the same processor as in production. Only the sensors and actuators are replaced by a wire. It is a bench facility for a test build, not an override on a running plant.

This is called Hardware-in-the-Loop (HIL). It is routine for aerospace and automotive controllers, and until now virtually unheard of on a micro-PLC.

Block diagram of HIL mode: the physical I/O is greyed out and bypassed by a HIL Port that injects inputs and captures outputs over USB serial, while the processor runs the identical control logic.
In HIL mode the physical I/O (greyed) is bypassed by the HIL Port. The processor runs the identical logic; inputs are forced and outputs read back over USB. Click to enlarge.

Three things it is not

Not a simulator.

Nothing is emulated on the PC. A test that passes is a test of the binary that ships.

Not a second codebase.

One call, eqsp32.beginHil(), enables HIL and one build flag turns it off for production. The logic is identical in both builds.

Not a paid option.

HIL is a standard part of the free EQSP32 library.

Test the cases you could never reach by hand.

Bench testing and commissioning only sample a controller's behaviour: the happy path and the few faults you dare to provoke. Because any input can be forced on demand, you reach the cases that are slow, dangerous or impossible to create on a real plant.

Dangerous faults, provoked safely

Testing over-pressure, dry-run or over-temperature for real risks the membrane, the pump, or worse.
Force the exact fault value over USB and watch the controller latch and shut down, with no plant and no risk.

Hours of timing, in seconds

Nobody sits through a 60-minute flush cycle or a 10-minute trip delay.
Time compression shortens production timers to seconds, so every time-based fault is exercised on every run. Only the timer constants are scaled, by a single build flag; the logic that reads them is untouched.

Exact thresholds & hysteresis

A real transmitter drifts and cannot be dialled to a precise value.
Force the trip point exactly, plus both edges of every hysteresis band, repeatably, to the digit.

Sensor & wiring faults

Simulating a broken wire normally means sabotaging the loop.
Force out-of-range and broken-wire values directly to prove every sensor-fault and fallback path.

The full matrix

By hand, full coverage rarely survives a deadline.
Every state, fault and interlock in the specification is driven, not a curated subset.

Regression after every change

Re-validating by hand after a small tweak usually does not happen.
Re-run the entire suite in under a minute and know that nothing else broke.

More coverage than commissioning can safely reach, and every case repeatable on demand.

By hand, by script, or by AI agent.

The forcing mechanism is the same in all three. What changes is who types the commands.

1

By hand

Type a command in a serial terminal: force an input, read an output. It is the quickest way to see how HIL works, and useful for a spot check on the bench.

2

By script

Put the same commands in a test script with the expected result for each step. You get a repeatable pass/fail test that you re-run after every change. No AI is involved.

Fastest
3

By AI agent

Writing a full test suite by hand is slow work. An AI agent writes the test plan and the script, runs them on the controller, and corrects the program until every check passes. You approve the specification first and review the test report at the end.

Read the app note

Start wherever you are comfortable. The tests you write by hand and the tests an agent writes run on the same hardware, the same way.

The AI writes the code. The hardware grades it.

Nothing the agent writes is accepted until the real controller has been driven through every specified condition and behaved correctly. You hold the two gates: approve the specification at the start, accept the test report at the end.

Workflow diagram. User side: process diagram, wiring diagram and prompt feed the project specification, which comes back for review and approval; at the end, working code and the test report come back for acceptance. Agent side: specification, test program definition, write-build-run code, Hardware-in-the-Loop test and debug, looping on failure until every check passes.
Your side is on the left, the agent's on the right. Between your two gates, the agent writes, builds, tests on the EQSP32 and loops on every failure. Click to enlarge.

The author never grades itself

A passing report records what the physical EQSP32 did, not the agent's opinion.

Bugs and hallucinations fail the test

A wrong trip fails a hardware check whether it came from a typo, a misread setpoint or an invented detail.

Everything is auditable

Specification, test plan, commented program and test report: the set a design review asks for.

Works with any capable agent. Tell it an EQSP32 is connected to the PC and point it to the EQSP32 library on GitHub.

Read the app note
The proof

A water treatment skid, programmed and tested on hardware in 18 minutes.

31/31
FAT steps passed on hardware
18min
Approved spec to tested controller
<1min
Full suite re-run after a change
1
USB cable, no plant wired
Reverse-osmosis water treatment skid with membrane housings, pump, and control panel

A real reverse-osmosis skid: ten sensors, three actuators, eight states, five fault conditions. Starting from a specification the engineer had approved, the agent delivered a controller validated on the hardware and a full test record, in effect a 31-step FAT run without the panel, in eighteen minutes. Commissioning against the real skid, the SAT, remains the next, separate step.

See the full demo

The complete build, step by step: the specification, the test plan, the HIL test run and the test report.

Not just the I/O. Modbus and MQTT too.

The same principle applies to every interface the EQSP32 speaks: exercise the real logic, observe the real traffic, and judge it from outside the controller.

Modbus / fieldbus

A USB-to-RS485 adapter lets the test side play the opposite role. If the EQSP32 is the master, the test acts as the slave, and the reverse. It loads registers with test values, drives requests, and confirms the EQSP32 sends the right traffic and handles the replies correctly, including malformed and out-of-range responses.

MQTT / IoT

The test publishes and subscribes on the same topics the EQSP32 uses, as its real peers would. It checks reconnects, retained messages, payload format, QoS and the reaction to bad messages. Any broker works, local or cloud, with no extra hardware.

Block diagram extending the HIL approach to network interfaces: the test side connects to an MQTT broker, a Modbus TCP endpoint and a USB-to-RS485 adapter, verifying the EQSP32 as a Modbus peer and an MQTT client while the HIL Port exercises the pins.
The same approach, extended to the network: the test side verifies the EQSP32 as a Modbus peer and an MQTT client, exercising each real interface exactly as the HIL Port exercises the pins. Click to enlarge.

Hardware-level testing, at almost no cost.

Nothing on the test side carries a license fee. If you choose to use an AI agent, that is the only running cost.

Free

EQSP32 library, HIL included

The full library, with all Hardware-in-the-Loop functions, is free. HIL is a standard feature, not a paid tier.

Free

Compiler & toolchain

The build toolchain is open source. No IDE license, no seat fees, no runtime charges.

Optional

The AI agent & model

A small cost per project with a frontier tool, and close to nothing with open-source models. It pays for the test writing that deadlines usually squeeze out.

The platform is free and the testing is free. The agent is optional, and costs far less than the bench time it saves.

Ship control logic that has already been proven on the hardware.

Native Hardware-in-the-Loop is a standard feature of the EQSP32, not an add-on. Use it to test the code you write, or to hold AI-written code to the same standard.

Shopping Basket

Contact us for Availability

Try EQComposerBuild your system interactively