- Checkout/pull Simulink model from repository to your local.
- Run Simulink model and confirm it finishes as expected. If not, inform the model maintainer and ask them to commit/push the model with correct settings to repo.
- Confirm that C/C++ code can be generated from model. Sometimes an s-function build file (mexw64) exists but its source code is missing, which allows the model to run but prevents code generation.
- Copy code to Visual Studio and verify that you can build and run it. There are cases where Simulink is more forgiving of errors like uninitialized variables, or missing #include <cmath> but Visual Studio cannot build the code.
- Copy code to real time Linux PC and verify code can be build there too.
- Commit code to its own repo.
- Run HIL with new code and verify HIL works as expected.
C++ and MATLAB Simulink tips for HWIL simulation software engineers
Sunday, September 22, 2024
Using code from Simulink model in HIL
Steps of converting a Simulink model to code usable in Hardware-in-the-loop (HIL) simulation:
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment