Issue in creation of test harness of a Simulink state in stateflow or creation of harness of a subsystem present in simulink state of stateflow.

조회 수: 4 (최근 30일)
Hello,
I wish to create a harness of a simulink state present in a stateflow.I am not getting the option of 'Test Harness',when right clicked on state
Also i tried to create a harness of a subsystem present in that simulink state but got the following error
So is there any other way to create test harness of such simulink state or subsystem present in that simulink state?
If not then can you suggest how to test such state by creating test hanress?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2025년 1월 9일
I don't think a "system under test" can be a "state" in a state chart. A typical "system under test" has inputs, while a "state" has transitions. The "inputs" of the "state" are determined by its content and the statechart.
  댓글 수: 2
Abhijeet Kate
Abhijeet Kate 2025년 1월 10일
Hello,
We need to do testing of logic present in those state by creating a test harness.Suppose the logic is simple addition or any 'AND' gate present in a subsystem in that state.I want to generate a harness of that subsystem and test it.Is it possible to generate such harness of subsystem present in a state?
Fangjun Jiang
Fangjun Jiang 2025년 1월 10일
If you make it a separate subsystem block, there would be no problem generating the test harness.
MATLAB/Simulink has provided many flexibilities, allowing MATLAB to include Simulink, allowing Simulink to include MATLAB, subsystem to have state, state to have subsystem, etc. you need to pick the best approach based on your need and the constraints by the tool.
The test harness can't be generated for a state, or any contents/components inside the state. That seems to be a clear constraint, if you see that all the test harness does is to provide inputs/outputs, not transitions.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Inputs에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by