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

6 views (last 30 days)
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'.

Answers (1)

R
R on 25 Mar 2024
Edited: R on 25 Mar 2024
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 Comment
Lev Vitkin
Lev Vitkin on 24 Jul 2024
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?

Sign in to comment.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!