ECU bench test automation in JavaScript

Write bench tests as scripts that drive the supply, relays and current meters, with ready tests for sleep current, wake-up frames, ignition cycling and under/overvoltage DTCs. HTML and JUnit reports.

How to use it

  1. Connect the instruments on the bench page’s tabs (or start the simulated bench), and name the relays KL30 and KL15.
  2. Open a bench example (sleep current, wake-up frames, ignition cycling, under- and overvoltage) and change the constants at its top to your ECU’s values.
  3. Run it: each step, check, measured value and current trace is listed; save the result as an HTML report or JUnit XML for CI.

Questions

What language are the scripts?

JavaScript with await, run in a worker in the browser. The bench functions (psu, relay, current, meter, dtcs) sit next to the bus functions (send, waitFor, uds, restbus), so one script can switch the ignition and check the bus.

Where do DTCs come from?

dtcs() reads the simulated ECU, or a car or ECU through an ELM327 connected on the OBD-II scanner page. With a CAN interface on the live bus page, read them with uds("19 02 09") in the same script.

Can CI run these tests?

The JUnit XML export is what Jenkins, GitLab and GitHub Actions read, and the test report viewer compares runs. The scripts themselves run in the browser, next to the instruments, not on a CI server.

Are my scripts kept?

They are saved in this browser as you type, and can be saved to and opened from .js files to share with the team or keep in version control.

Related tools

  • ECU test bench: lab supply, multimeter, relays, PPK2: Drive the instruments on an ECU bench from the browser: a lab power supply (SCPI on LAN or USB, Korad, Riden), a multimeter, a USB relay board for KL30 and KL15, and a Nordic PPK2. Live charts, voltage profiles, ignition cycles and a sleep-current test. Or try the simulated bench.
  • Lab power supply control (SCPI, Korad, Riden): Set voltage and current limit, switch outputs and chart voltage and current live on a Rigol, Siglent, Keysight, R&S, Owon, Korad/Tenma or Riden supply, over LAN or USB. Record to CSV.
  • Battery voltage profile player for a lab supply: Draw a supply-voltage profile from holds and ramps (slow decrease, dips, cranking-shaped, overvoltage), repeat it and play it on a lab supply, with the measured voltage beside it. Your levels and times; shareable by link.
  • Bench multimeter logger (SCPI): Read a Keysight, Rigol, Siglent, Owon, Fluke or Keithley multimeter over LAN or USB: DC and AC volts and amps, resistance, at a set interval, charted with min, mean and max, saved as CSV.
  • USB relay board control and ignition cycling: Switch a USB HID relay board or an LCUS serial relay from the browser, name each relay (KL30, KL15), pulse it, and cycle the ignition a set number of times.
  • Test report viewer (JUnit, TRX, NUnit, xUnit): CI and HIL test results: summary, suites, failures with output; compare runs for new failures, fixes and flaky tests.
  • OBD-II scanner (ELM327): Read and clear fault codes, live data, readiness, freeze frames, Mode 06 results and the VIN through an ELM327 over USB, Bluetooth or Bluetooth LE; UDS, a CAN monitor and a terminal too.

Also useful for: hil test automation, bench automation, test script, automated ecu test, ignition cycle test, wake-up test, undervoltage dtc, junit, python alternative, labview alternative.