How to create one common harness?

5 ビュー (過去 30 日間)
Oleksandr Denysenko
Oleksandr Denysenko 2021 年 4 月 12 日
回答済み: Sameer 2025 年 5 月 8 日
Hi
I have big Simulink model with contains of subsystems. Each subsystem is a link to the custom Simulink library. But they are not unique. I mean, that there could be two subsystems with links to the one common custom Simulink library.
I'm creating Simulink Test Harnesses for each of these subsystems. But as i said, they could be same.
So, is it possible to have one common Simulink Test Harness model for this different subsystems which are links to the same library?

回答 (1 件)

Sameer
Sameer 2025 年 5 月 8 日
The best way is to create the test harness directly on the library block itself, not on each individual subsystem instance in your main model.
Here’s how you can do it:
1. Open your custom library.
2. Right-click the block you want to test.
3. Select Test Harness > Create for 'BlockName'.
Now, this harness will test the block’s behavior, and it applies to all instances of that block in your models. This way, you only need to maintain one test harness, and it covers every subsystem linked to that library block.
Hope this helps!

カテゴリ

Help Center および File ExchangeInputs についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by