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.

Framework datasheet
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
RepeatableEvery run starts from the same known state, with the same stimulus and timing.
UnattendedBatches run overnight. Every test ends in a safe state, whether it passed or failed.
TraceableEach run keeps its inputs, configuration, recordings, logs and report together in one folder.
PortableBench-specific settings live in one configuration file, so the framework moves between programs.
The problem

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.

Our approach

Separate what to test from how the bench runs it.

  • 01
    Test definitions

    describe the inputs, timing, fault cases and plots. They contain no bench code.

  • 02
    The automation engine

    carries out any definition on the bench through standard interfaces.

  • 03
    The bench configuration

    maps logical names to model paths, signals and hardware in one place.

  • 04
    Evaluation and reporting

    turn each recording into plots, pass/fail checks and a report automatically.

Architecture

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 feed the automation engine in ControlDesk, which drives the real-time platform and fault insertion unit through the ASAM XIL API. Recordings go to MATLAB for evaluation and reporting. TEST DEFINITIONS Test filesParameters, stimulus profiles Fault tablesTimed or condition-based Plot & evaluation pagesSignals, limits, checks Batch listsCampaigns & regressions dSPACE CONTROLDESK Automation engine (Python) • Sequence & timing • Pre-run checks • Recorder set-up & trigger • Fault-plan builder • Safe stop & restore • Logging & results Bench configurationPaths, signals, timing ASAM XIL · MAPort Real-time platform Plant model, I/O,signal generators ASAM XIL · EESPort Fault insertion unit Open, short to ground,short to supply, pin-to-pin DEVICE UNDER TEST Controller Production ordevelopment hardware MATLAB Evaluate & report Plots, pass/fail,PDF report recording, results, logs

Test definitions describe intent. The engine turns them into bench actions through standard ASAM XIL ports. Recordings come back for automatic evaluation.

Test lifecycle

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.

  1. Prepare

    Create a time-stamped results folder. Archive the test definition, plot pages and active bench configuration with it.

  2. Parse & check

    Read the test definition. Check that every parameter, signal and fault pin exists on this bench before any hardware is energized.

  3. Reset to known state

    Power-cycle the device under test and reload the real-time application so every parameter returns to its default.

  4. Configure

    Write test parameters and download stimulus profiles to the signal generators. Hold the simulation until everything is ready.

  5. 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.

  6. 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.

  7. 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.

  8. 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.

Capabilities

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.

HIL-01

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.

HIL-02

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.

HIL-03

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.

HIL-04

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.

HIL-05

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.

HIL-06

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.

HIL-07

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.

HIL-08

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.

What a test looks like

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 };
Evidence

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.

OutputWhat it containsWhy it matters
Archived inputsThe test definition, plot and evaluation pages, and the exact bench configuration usedShows what was run, so the test can be reproduced later
Raw recordingAll captured signals on a common time baseCan be re-evaluated or replotted without running the bench again
PDF reportPlots, numeric tables, pass/fail evaluation, fault markers, device version, active-fault summaryReady for review and sign-off as verification evidence
Test logTime-stamped record of every bench action, fault change and error detailSpeeds up root-cause analysis and gives an audit trail
Campaign summaryOne row per test with status, duration, folder and messageShows campaign status at a glance and makes it easy to compare regressions
Built-in safeguards

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.
Toolchain

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.

dSPACE ControlDesk dSPACE SCALEXIO ASAM XIL · MAPort ASAM XIL · EESPort Fault insertion units Python MATLAB Simulink plant models Git
FAQ

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.

Next step

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.