Borrar filtros
Borrar filtros

Test Simulink model with functions running at different sample time.

2 visualizaciones (últimos 30 días)
Diana
Diana el 19 de Abr. de 2024
Editada: Fangjun Jiang el 19 de Abr. de 2024
Hello,
I'm using Simulink test to evaluate a Simulink model that contains a main function with a sample time of 4msec and another function XYZ (sample time 2msec) that handles data from the main function.
For the testing I have created a test harness with a sequence block (sample time set to 4 msec) for implementing the test steps and verifying the output signals.
Because of the different sample times 4 and 2, Matlab is complaining (see caption attached). How can I handle this error?
Thanks much for you support!
Update: if I press the FIX button (see the attached screenshot) and having the sample time of the test sequence set to 4msec, I will get the following error:
"Inside the model referenced by Model block '.....', the function-call context driven by the function-call signal to its input port '....' has specified the sample time of 0.002 on the dialog of corresponding Inport block. However, the function-call initiator '...Test Sequence' has a sample time of 0.004 that can not provide enough resolution. Consider changing sample time of .../Test Sequence to a value such that the sample time 0.002 is its integral multiple."
What settings should I make so that I no longer receive such errors and to be sure that the system testing is done correctly from this point of view?
Thanks much for you support!

Respuestas (1)

Fangjun Jiang
Fangjun Jiang el 19 de Abr. de 2024
Editada: Fangjun Jiang el 19 de Abr. de 2024
You need to make your test sequence, function-call trigger, or source signal update rate, etc. be the fast rate (2ms). The slow task rate (4ms) will be executed because the system can slow down, or wait for every other trigger of the 2ms task.
If you do the opposite (making the test sequence be the slow rate, 4ms), then there is no way to execute the faster rate task (2ms).

Productos


Versión

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by