In blockset designer, how do I add a test harness to a subsystem that has a bus input?
3 ビュー (過去 30 日間)
古いコメントを表示
1.) Create an "Empty Subsystem".
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/821325/image.jpeg)
2.) Once it is created and opened, attach the model to a data dictionary that contains a bus object.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/821330/image.jpeg)
3.) Once attached to the data dictionary, set the inport datatype to the bus in the dictionary.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/821335/image.jpeg)
4.) Save the model and return to the blockset designer. For the block, under test, click "Create".
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/821340/image.jpeg)
Once I do this I get the following error from the UI,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/821345/image.jpeg)
Additionally, on the MATLAB command line the following message will be displayed,
'An error occurred while trying to generate the simulation input. Check your model configuration and ensure the external input interface is configured properly.'
Looking at model options for the block there are only codegeneration options.
tldr;
I am just trying to create an "Empty Subsystem" block in the blockset editor that can take a bus (defined in a data dictionary) as an input and create a Test (harness model) for it. Reference manual and examples all only take in 'double' data types, so how to do this?
0 件のコメント
採用された回答
Abhiroop Rastogi
2022 年 2 月 14 日
Hi Jeremy,
This is as issue with the automatic test harness creation feature in Blockset Designer. The issue occurs when a bus object is specified on the input of the library block. Blockset Designer isn't correctly identifying that the input to the block needs to be a bus, so the harness fails to compile.
The currently workaround is to create the block tests manually, and add them in the Blockset Designer as shown in the documentation link below:
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Test Harnesses についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!