User`s guide
Verify Generated Code for a Component
12-9
runcgvopts.cgvConn = 'sim';
3
Execute the slvnv_powerwindow_controller model using the two test cases and
the runopts object:
cgvSim = slvnvruncgvtest('slvnvdemo_powerwindow_controller', ...
mergedTestCases, runcgvopts);
These steps save the results in the workspace variable cgvSim.
Next, execute the same model with the same test cases in Software-in-the-Loop (SIL)
mode and compare the results from both simulations.
For more information about Normal simulation mode, see “Execute the Model”.
Execute Component in Software-in-the-Loop (SIL) Mode
When you execute a model in Software-in-the-Loop (SIL) mode, the simulation compiles
and executes the generated code on your host computer.
To execute a model in SIL mode, you must have an Embedded Coder license.
In this section, you execute the slvnvdemo_powerwindow_controller model in SIL
mode and compare the results to the previous section, where you executed the model in
simulation mode:
1
Specify to execute the model in SIL mode:
runcgvopts.cgvConn = 'sil';
2
Execute the slvnv_powerwindow_controller model using the merged test cases
and the runopts object:
cgvSil = slvnvruncgvtest('slvnvdemo_powerwindow_controller', ...
mergedTestCases, runcgvopts);
The workspace variable cgvSil contains the results of the SIL mode execution.
3
Compare the results in cgvSil to the results in to cgvSim (the results from the
simulation mode execution). Use the compare (cgv.CGV) method to compare the
results from the two simulations:
for i=1:length(loggedSignalsHarness.TestCases)
simout = cgvSim.getOutputData(i);