- Open the example model and change the codegen target to "ert.tlc".
- Go to "Configuration > Code Generation > Verification > Advanced Options > Create Block" and set it as "SIL".
- Wrap a part of the model into a subsystem (as shown in the picture below) and try to build the subsystem into a C/C++ code. Then you will get a similar error to yours.
SIL error (Unable to find function)
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jung Sunghun
am 15 Nov. 2023
Bearbeitet: Angelo Yeo
am 15 Nov. 2023
Hello all,
I am currently having trouble when I try to run the SIL simulation. As shown in the following capture, I simply created the SIL block (UKF_EKF_1TC_SIL) which is identical to the original block (UKF_EKF_1TC).
When I try to run "Run Verification" by setting "SIL/PIL > System Under Test: Model blocks in SIL/PIL mode," the simulation fails due to the following error message.
It seems like both the "EKF" and "UKF" blocks located in the "UKF_EKF_1TC_SIL" which refer to "batteryStateFcn" and "batteryMeasurementFcn" cannot call it due to an unknown reason whereas "UKF_EKF_1TC" works great by calling up both the "batteryStateFcn" and "batteryMeasurementFcn".
I would appreciate it if anyone could guide me in the correct direction. Thank you very much in advance.
0 Kommentare
Akzeptierte Antwort
Angelo Yeo
am 15 Nov. 2023
Bearbeitet: Angelo Yeo
am 15 Nov. 2023
BLOT: You need to have Simulink functions inside the SIL model to build C/C++ code.
I was able to reproduce your issue with a shipped example below.
Below are my reproduction stpes.
The solution here is to put the Simulink functions for calculating state transition and measurements into the subsystem.
Hence, in your case, put all the Simulink functions for calculating state transition and measurement into "UKF_EKF_1TC" subsystem and generate a SIL model block out of it. Do not forget to change the options described in the reproduction step 2 if you want to build a subsystem solely for SIL.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!