2
votes

I've been having this issue since I started using this Simulink model. No matter what I try, Simulink rebuilds the model every time I run it. I've taken a look at the checksums using the following procedure:

>> [cs1, cs1det] = Simulink.BlockDiagram.getChecksum(<model name>);
>> (Here I hit run on the model without changing anything)
>> [cs2, cs2det] = Simulink.BlockDiagram.getChecksum(<model name>);
>> cs1 == cs2
    1
    1
    1
    1

Why would Simulink rebuild the model if the checksums are the same? I did create another model with some simple logic in it and after compiling once I was able to run it multiple times without Simulink recompiling it.

Additionally, when I hit run when in Rapid Accelerator mode I notice that an asterisk pops up next to the model name in the title. Since this means that the model has unsaved changes, could running it cause any changes to be made? I've checked the callback methods and there's nothing being run when the sims starts (in fact there's nothing in any of the callback methods).

Is there some kind of basic compilation / initialization / build that Simulink runs through before it runs every time? I'm trying to run my model in Rapid Accelerator mode without having it recompile since it takes roughly 45 minutes to compile every time.

Have I overlooked some configuration parameter of the model? Is there some global MATLAB/Simulink variable I need to change?

2
Do you have any model initialization code which changes block or model parameters?Navan

2 Answers

1
votes

Is it building or is it updating?

Typically, when you hit the Run button, MATLAB has to propagate signals, check your model for errors, initialize variables . . .

It may seem like building, but to actually confirm it is building, check to see of you have yourmodelname.c file in the folder.

Also check File Menu preferences, and go through the functions there and see if something is getting called.

0
votes

Could you try to set Configuration Parameter -> Code Generation -> Interface -> Code replacement library to None (In case that your demand is not related to GNU library ...) on reference model? By the way, it is working for me.