How to use Test Sequence as a function call for a test harness

조회 수: 37 (최근 30일)
ambre allard
ambre allard 2022년 7월 18일
댓글: ambre allard 2022년 7월 19일
Hi everyone,
I'm trying to create a test harness using the "Add scheduler for function-calls and rates = Test Sequence". When I create the test harness, some default code is implemented in the test sequence code :
Run
%% Initialize data outputs.
a = single(0);
b = false;
send(D1);
If I add more setp to my test sequence I get teh following error:
  • Input port 'D1[0.02]' of Model block 'Model' must be executed periodically when it is activated (enabled) by its function-call initiator when the Model block has the 'Show model periodic event ports' parameter selected. The function-call initiator connected to input port 'D1[0.02]' did not execute the Model block on time step '0.02'.
The only way I found to make the test harness run is to add the "send(D1);" command in every step of the test sequence..
What is the correct way to use a test sequence as a function call in a test harness ?
Thanks for your help !

채택된 답변

Swetha Murali
Swetha Murali 2022년 7월 19일
편집: Swetha Murali 2022년 7월 19일
It seems to me from the image that you posted of the step that the same Test Sequence Block is being used to schedule and drive your inputs. If you want to use the same block for both of these purposes, then yes, you do need to add a "send" to each step.
If you use the above recommendation made by Pat Canny/Rong Mi, the inputs and function calls will be separated in two different Test Sequence blocks and the function call won't have to be triggered again and again when you add additional steps to configure your inputs.

추가 답변 (1개)

Pat Canny
Pat Canny 2022년 7월 19일
My colleague @Rong Mi has a great suggestion:
Similar as Chart, Test Sequence also supports “send” to schedule function call. Both of them can be used as the function scheduler. In the example of how to schedule using Stateflow, if “Test Sequence” is selected, (Please see the below image), the automatically generated Test Sequence caller in the harness model will be configurated to use “send”. This example how to schedule using Stateflow can be re-used to explain Test Sequence use case.
Hopefully this helps. Thanks.

카테고리

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

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by