HIL testing on dSPACE benches, automated from stimulus to report.
We build automation frameworks that run inside dSPACE ControlDesk. Engineers write a test once, as a short readable definition. The bench then runs it on its own, the same way every time, and returns evidence ready for review.
- Host
- dSPACE ControlDesk (Python automation)
- Bench access
- ASAM XIL API: MAPort and EESPort
- Platform
- dSPACE real-time systems (e.g. SCALEXIO)
- Fault classes
- Open, short to ground, short to supply, pin-to-pin
- Execution
- Single test or unattended batch campaign
- Evaluation
- MATLAB post-processing and pass/fail checks
- Outputs
- PDF report, raw recording, logs, campaign summary
Manual HIL testing doesn't scale.
On a hardware-in-the-loop bench, a real controller is connected to a real-time simulation of the system it controls. That makes the bench one of the most valuable verification tools a program has. Run by hand, it is also one of the slowest. An engineer sets parameters in the layout, starts a recording, switches faults at the right moment, exports data and assembles plots. Each of those steps can go wrong.
When requirements change or a new software build arrives, the whole campaign has to be repeated. Without automation, regression testing on the bench gets put off, and the evidence varies with whoever ran the test.
Separate what to test from how the bench runs it.
- 01Test definitions
describe the inputs, timing, fault cases and plots. They contain no bench code.
- 02The automation engine
carries out any definition on the bench through standard interfaces.
- 03The bench configuration
maps logical names to model paths, signals and hardware in one place.
- 04Evaluation and reporting
turn each recording into plots, pass/fail checks and a report automatically.
One engine, standard interfaces, any test.
The automation runs as Python inside ControlDesk, so it works alongside the experiment and layouts your team already uses. It reaches the real-time platform through the ASAM XIL API, the industry standard for test-bench access. MATLAB handles evaluation and report generation.
Test definitions describe intent. The engine turns them into bench actions through standard ASAM XIL ports. Recordings come back for automatic evaluation.
Every test runs the same sequence.
Whether a test runs by itself or as one of hundreds in an overnight batch, the engine takes it through the same steps. Each step is logged with a timestamp.
Prepare
Create a time-stamped results folder. Archive the test definition, plot pages and active bench configuration with it.
Parse & check
Read the test definition. Check that every parameter, signal and fault pin exists on this bench before any hardware is energized.
Reset to known state
Power-cycle the device under test and reload the real-time application so every parameter returns to its default.
Configure
Write test parameters and download stimulus profiles to the signal generators. Hold the simulation until everything is ready.
Power up & initialize
Release the hold and power the device. Apply diagnostic set-up and fault resets, and record the device's software version for the report.
Stimulate, inject, record
Arm the recorder on a common trigger. Start the stimulus and apply each scheduled fault at its time or when its condition is met.
Restore safe state
Stop the recording, remove all faults, stop the stimulus and apply end-of-test settings. This happens after aborts and errors too.
Evaluate & report
Post-process the recording, evaluate it against the expected results and write a paginated PDF report, then add a line to the campaign summary.
What the framework provides.
Each capability is part of the framework we hand over. Your team can run, extend and maintain it after the engagement ends.
Data-driven test definitions
Tests are short, readable text files that hold parameters, time-based stimulus tables, fault schedules and plot selections. Test engineers write them without touching automation code, and they can be reviewed and version-controlled like any other artifact.
Standards-based bench access
All model and hardware access goes through the ASAM XIL API (MAPort for model variables, EESPort for fault insertion), so the tests are not tied to one layout or hand-built script. Model paths are looked up from templates, so a new model version doesn't mean editing tests.
Scripted fault injection
Electrical faults (open circuit, short to ground, short to supply, pin-to-pin) are listed as a simple timeline. Faults can also start when a condition on a live signal is met. The engine builds the error sets, checks every pin and fault class against the bench's signal list, and records when each fault was applied and removed.
Repeatable initial conditions
A controlled power cycle, application reload and simulation hold put every test in the same known state. A synchronized trigger aligns stimulus, faults and recording on one time axis.
Automated evaluation & reporting
Recordings are resampled to a common rate and plotted. Evaluation pages check timing, thresholds, state transitions and step responses against the expected results. Every test produces a consistent PDF that shows fault markers, the device version and the bench configuration on every page.
Batch campaigns & safe stop
Batch lists run whole procedures or full regressions unattended. If one test fails, the batch logs it and moves on. A two-stage stop lets an operator either finish the current test cleanly or abort it at once. Either way the bench is returned to a safe state.
Diagnostics you can act on
Each test has a detailed log covering every write, model command and measured signal. Errors are reported with the full Python, MATLAB and API detail. A campaign log and results table give the status of every run.
Configuration, not customization
Model roots, signal paths, power and trigger signals, timeouts and report format all live in one configuration file. Moving the framework to a new bench, model or tool release is a configuration change, not a rewrite.
Readable by the people who review it.
A test definition says what happens and when. It doesn't say how the bench does it. Reviewers can trace each line back to a procedure step, and the same file runs on any bench that has a matching configuration.
Times are on the same axis as the report plots, so what you read in the test file matches what you see in the report.
% Illustrative test definition TINIT = -2; % pre-trigger recording (s) TFLIGHT = 30; % test duration (s) PlotFile = 'StepResponse.MPLT'; PlotTitle = 'Input step, nominal conditions'; % Stimulus profile: [time, value] Input_Cmd = [ 0 10 5 10 5.2 50 15 50 ]; % Start Stop Fault Pins Load FIU = { 12 16 'Open' 'Sensor_A' 0 20 inf 'Ground' 'Discrete_1' 1 };
Every run leaves a complete record.
Verification evidence has to stand up to review. Each test writes everything needed to understand and reproduce it into its own folder.
| Output | What it contains | Why it matters |
|---|---|---|
| Archived inputs | The test definition, plot and evaluation pages, and the exact bench configuration used | Shows what was run, so the test can be reproduced later |
| Raw recording | All captured signals on a common time base | Can be re-evaluated or replotted without running the bench again |
| PDF report | Plots, numeric tables, pass/fail evaluation, fault markers, device version, active-fault summary | Ready for review and sign-off as verification evidence |
| Test log | Time-stamped record of every bench action, fault change and error detail | Speeds up root-cause analysis and gives an audit trail |
| Campaign summary | One row per test with status, duration, folder and message | Shows campaign status at a glance and makes it easy to compare regressions |
Designed to fail safe.
- Parameters, signals and fault pins are checked before the device under test is powered.
- Faults are checked against the bench's allowed fault classes, timing limits and overlap rules.
- Faults are always removed and end-of-test settings always applied, including after an error or abort.
- Every wait can be interrupted, so an abort takes effect within a fraction of a second.
- Optional automatic power-off of the device under test when a run is aborted.
Built on the tools you already own.
The framework adds automation to your existing dSPACE environment. Your experiment, layouts and models stay as they are.
Common questions about HIL automation.
Short answers to the questions we hear most from teams with dSPACE benches.
Can dSPACE ControlDesk tests be automated?
Yes. ControlDesk runs Python, so an automation framework can run inside the experiment your team already uses. It reads each test definition, sets up the bench, records the run and produces the report without manual steps.
What is the ASAM XIL API?
ASAM XIL is an industry standard for connecting test automation software to test benches. Its MAPort gives access to model variables on the real-time platform, and its EESPort controls electrical error simulation through fault insertion units. Building on it keeps tests independent of a single layout or hand-written script.
Do we have to change our models or ControlDesk layouts?
No. The framework works with your existing experiment, layouts and models. Bench-specific details such as model paths, signal names, power and trigger signals and timing go into one configuration file.
Can our existing manual HIL procedures be converted?
Yes. Each procedure step becomes a short test definition with its parameters, stimulus profile, fault schedule and plots. The expected results become automated evaluation checks, so the procedure can be rerun on every new software build.
What fault injection does the framework support?
Open circuit, short to ground, short to supply and pin-to-pin shorts, with or without load where the hardware allows. Faults can be applied at set times or when a condition on a live signal is met. All faults are checked against the bench's signal list before the device under test is powered.
What evidence does each automated test produce?
Each test writes its own folder with the archived inputs and configuration, the raw recording, a PDF report with plots and pass/fail results, a detailed time-stamped log, and a line in the campaign results summary.
Getting more out of your HIL bench?
We can automate an existing bench, move legacy scripts to a standards-based framework, or turn written test procedures into runnable automated campaigns. Then we hand it over so your team can run it.