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

6 visualizaciones (últimos 30 días)
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 comentarios
Chuguang Pan
Chuguang Pan el 13 de Mzo. de 2024
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 el 15 de Mzo. de 2024
Editada: Nhan Phan Trung el 15 de Mzo. de 2024
I'm also facing this issue. Are there any ways to fix this without modifying anything from test harness?

Iniciar sesión para comentar.

Respuestas (1)

R
R el 25 de Mzo. de 2024
Editada: R el 25 de Mzo. de 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 comentario
Lev Vitkin
Lev Vitkin el 24 de Jul. de 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?

Iniciar sesión para comentar.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by