Is it possible to access the blocks inside the model under test from the test harness in custom criteria script of simulink test?
I would like to verify the datatype of inports and outports of a model in simulink test. So I created a test harness for it and when I try to access the inports inside the model under test in test harness from the custom cirteria script of simulink test, it doesnt work.
function ioAnalysisFunc(test)
res = get_param(strcat(test.sltest_bdroot, ‘/Model1/Inport1’), ‘OutDataTypeStr’); % Here test.sltest_bdroot is the test harness ‘Model1_Harness’
assignin(‘base’, ‘ress_out’, res{1});
end
The error thrown is,
——————————————————————–
Error occurred in custom criteria and custom criteria assessment did not run to completion.
——— Error ID: ———
Simulink:Commands:InvSimulinkObjectName
————– Error Details: ————–
Invalid Simulink object name: ‘Model1_Harness/Model1/Inport1’.
——————————————————————–I would like to verify the datatype of inports and outports of a model in simulink test. So I created a test harness for it and when I try to access the inports inside the model under test in test harness from the custom cirteria script of simulink test, it doesnt work.
function ioAnalysisFunc(test)
res = get_param(strcat(test.sltest_bdroot, ‘/Model1/Inport1’), ‘OutDataTypeStr’); % Here test.sltest_bdroot is the test harness ‘Model1_Harness’
assignin(‘base’, ‘ress_out’, res{1});
end
The error thrown is,
——————————————————————–
Error occurred in custom criteria and custom criteria assessment did not run to completion.
——— Error ID: ———
Simulink:Commands:InvSimulinkObjectName
————– Error Details: ————–
Invalid Simulink object name: ‘Model1_Harness/Model1/Inport1’.
——————————————————————– I would like to verify the datatype of inports and outports of a model in simulink test. So I created a test harness for it and when I try to access the inports inside the model under test in test harness from the custom cirteria script of simulink test, it doesnt work.
function ioAnalysisFunc(test)
res = get_param(strcat(test.sltest_bdroot, ‘/Model1/Inport1’), ‘OutDataTypeStr’); % Here test.sltest_bdroot is the test harness ‘Model1_Harness’
assignin(‘base’, ‘ress_out’, res{1});
end
The error thrown is,
——————————————————————–
Error occurred in custom criteria and custom criteria assessment did not run to completion.
——— Error ID: ———
Simulink:Commands:InvSimulinkObjectName
————– Error Details: ————–
Invalid Simulink object name: ‘Model1_Harness/Model1/Inport1’.
——————————————————————– simulink test, custom criteria script, get_param MATLAB Answers — New Questions