Automating Test Harness creation and auto-filling Test Sequence using App Designer in Simulink

I am trying to automate the creation of a Simulink Test Harness using App Designer and configure it programmatically.
Specifically, I want to:
  • Load a Simulink model dynamically from the app
  • Automatically create a Test Harness for a subsystem using:
sltest.harness.create
  • Use Test Sequence as the source (same as GUI setup)
  • Open the harness after creation
  • Programmatically access the Test Sequence block
  • Automatically populate Test Sequence steps and assign input signals
  • Optionally drive inputs using Excel data
I am currently able to load the model and trigger harness creation from a button in App Designer. However, I am facing issues with:
  1. Correctly identifying the subsystem (ownerPath) for harness creation
  2. Ensuring harness is actually created (avoiding "No harness exists" errors)
  3. Handling string vs char issues for harness name ('Name' must be char)
  4. Programmatically accessing and modifying the Test Sequence block
  5. Automatically creating steps and transitions inside Test Sequence
What is the recommended and robust way to:
  1. Automatically select the correct subsystem for harness creation?
  2. Ensure harness creation works reliably inside App Designer?
  3. Programmatically populate Test Sequence with multiple steps (especially from Excel input)?

Answers (0)

Categories

Find more on Verification, Validation, and Test in Help Center and File Exchange

Asked:

on 11 May 2026 at 11:17

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!