sltest.harness.create function input 'source' can't be set 'Signal Builder' in parameter pairs in matlab 2022b

6 ビュー (過去 30 日間)
sltest.harness.create('Harness_Test','Source','Signal editor','Sink','Outport');
error:
Expected input to match one of these values:
'Inport', 'Signal Editor', 'From Workspace', 'From File', 'Test Sequence', 'Chart', 'Constant', 'Ground', 'None', 'Custom'
The input, 'Signal Builder', did not match any of the valid values.
This means I can't assign 'Signal Builder' to 'Source', matlab version is 2022b, but there is no error in 2022a(Tested many times).
Is this issue related to matlab version and how to solve it? Still need to use 'Signal Builder'.
  2 件のコメント
Chuguang Pan
Chuguang Pan 2024 年 3 月 13 日
You can check the documentation of sltest.harness.create in your MATLAB version with doc command and examine the Source option.
Nhan Phan Trung
Nhan Phan Trung 2024 年 3 月 15 日
編集済み: Nhan Phan Trung 2024 年 3 月 15 日
I'm also facing this issue. Are there any ways to fix this without modifying anything from test harness?

サインインしてコメントする。

回答 (1 件)

R
R 2024 年 3 月 25 日
編集済み: R 2024 年 3 月 25 日
Hello,
I believe that Simulink is moving away from Signal Builder and therefore the harness support has been restricted. For reference, here is the documentation for 'signalbuilder' that displays a 'not recommended' warning:
To work around this, you can transition to the Signal Editor block. The Signal Editor provides similar functionality to the Signal Builder block but with greater flexibility. You can use the 'signalBuilderToSignalEditor' function that imports signal data and properties from the Signal Builder block to the Signal Editor block. You can then use this Signal Editor block as a source while creating the test harness.
Another workaround to use the Signal Builder inputs is to create the harness with Root Inports and enabling the option 'Create Scalar Inputs/AutoShapeInputs'. You can then manually replace the inports with a Signal Builder block.
Following is the documentation that details the Migration from Signal builder to Signal Editor block. I hope this provides some more clarity on the issue.
  1 件のコメント
Lev Vitkin
Lev Vitkin 2024 年 7 月 24 日
The question was not about the conversion of Signal builder to Signal Editor, but rather about The question was not about the conversion of the Signal Builder to Signal Editor, but rather about sltest.harness.create with the "Source" as Signal Builder:
sltest.harness.create with the "Source" as Signal Builder:
sltest.harness.create('Harness_Test','Source','Signal Builder','Sink','Outport') vs.
sltest.harness.create('Harness_Test','Source','Signal Editor','Sink','Outport');
If your Subsystem, which you want to create the Harness to, has an input as a virtual bus, then the Source option 'Signal Builder' works perfectly. However, the source option 'Signal Editor' requires the input bus to be non-virtual. And this a problem.
Any suggestions on how to create the scalar inputs in the Harness model without using the Signal Builder option of the sltest.harness.create?

サインインしてコメントする。

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by