Using Preprocessor directives, how could I generate an autocode using embedded coder in simulink? What are the feasible otions to change the autocode from these preprocessor directives during runtime?

Need to implement a simulink model in such a way that, the autocode generated would be containing all the switch logics that would be mentioned in the model.
Then , I need to select only that part of autocode to be executed, based on the selection of my preprocessor directives in the respective header files.
I tried to acheive solution for this requirement using variant subsystem; where i find both the switching logics in the autocode generated.
But, using thi smethod, the code that is to be used is not speciied at runtime.
The switching variable is not able to be changed once the model is build, which makes me to build the model everytime and generate autocode every time i build the model.
Rather, if I have any option to only use the particular part of code in autocode, without building the model everytime, then, i will be able to make changes runtime based on the switching parameter.

2 Comments

Hi Sasikanth,
I think it would probably help if you use if-else subystem of even switch case. Below links might be helpful for your use-case
Regards,
Shanmukha

Sign in to comment.

Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Asked:

on 20 Feb 2019

Commented:

on 14 Feb 2020

Community Treasure Hunt

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

Start Hunting!