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
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
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
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
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 Exchange 中查找有关 Inputs 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!