MIL SIL equivalence check.

7 visualizzazioni (ultimi 30 giorni)
Dhruvilkumar Chavada
Dhruvilkumar Chavada il 20 Feb 2024
I am currently working on process advisor example. I am using built in task to perform MIL test cases. I change the built in TestsPerTestCase.m to perform SIL test execution (using 22b, so simulation mode is not supported).
I have stored the result file two specific folder MIL_test and SIL_test (each has 3 results).
I want to create a custom task where i can perform MIL and SIL test execution, with builtin queries.
Any idea on how to perform this?
Currently i am using built in example

Risposte (1)

John D'Errico
John D'Errico il 20 Feb 2024
Modificato: John D'Errico il 20 Feb 2024
A literally impossible question to answer. Both far too broad, too vague, and yet extremely specific. It is not even clear what your question is specifically about, since you use jargon and acronyms that you may understand, yet are not terribly clear to the rest of the world.
How do you do it? Broadly, you:
  1. Write down the mathematics of what you need to do.
  2. Learn sufficient MATLAB to do what you need.
  3. Write the code to do what you want.
We can't teach you all the MATLAB you might need to learn here, since we have no clue as to what you already know, and don't know. So any attempt to tell you want you need to know would involve writing an entire book, when you might only need to read chapter 17.
So as I said above, start by carefully writing down the mathematics of the problem. Make sure you understand it.
Then, once you understand the mathematics of what you need to do, write a simple function that does the above computation, and returns the desired result. Don't worry about the interface. Fix the function until it performs as you need. Finally, build an interface around the code you have written.
  1 Commento
Dhruvilkumar Chavada
Dhruvilkumar Chavada il 20 Feb 2024
Sorry for not being clear.
MIL = Model in Loop test and SIL = Software in the loop test.
% Software in the loop
silresult = sltest.testmanager.importResults("HLR_11_SIL_ResultFile.mldatx")
TSObjSIL = silresult.getTestCaseResults()
% Model in the loop
milresult = sltest.testmanager.importResults("HLR_11_ResultFile.mldatx")
TSObjSim = milresult.getTestCaseResults()
idSim = TSObjSim(1)
resEq = Simulink.sdi.compareRuns(idSim, idSIL)
anyMismatch = false;
for iEqTest = 1:resEq.Count
if ~resEq.getResultByIndex(iEqTest).Match
anyMismatch = true;
I have 3 different test result files
folder SIL_test
folder MIL_test
I want to import the result file from these folders (store in project) one by one and compare the signal as mentioned above.
When HLR_11_ResultFile.mldatx is called HLR_11_SIL_ResultFile.mldatx.

Accedi per commentare.


Scopri di più su Test Model Components in Help Center e File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by