How to use Test Sequence as a function call for a test harness
Show older comments
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 !
Accepted Answer
More Answers (1)
Pat Canny
on 19 Jul 2022
1 vote
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.
Categories
Find more on Inputs in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!