Update blockset
A GOcontroll Simulink project made from GOcontroll-Simulink-Starter carries the GOcontroll Simulink blockset as the git submodule GOcontroll-Simulink and records which version of the blockset it uses. An older project keeps building with its own version until you update the blockset with git, as described here.
The update moves the submodule to the newest blockset and puts the GOcontroll CodeBase inside it on the version that belongs to that blockset. The blockset itself is never edited by hand.
Before you begin
- A project folder made from GOcontroll-Simulink-Starter, as described in Create model.
- Git, the same tool that was used to clone the project.
- MATLAB can be restarted after the update.
Update the blockset
In a Windows terminal in the project folder, fetch the newest blockset:
git submodule update --remote GOcontroll-Simulink
Then put the GOcontroll CodeBase inside the blockset on the version that belongs to it:
git -C GOcontroll-Simulink submodule update --init --recursive
Restart MATLAB in the project folder, build your models and check them.
When your models work with the new blockset, commit the changed submodule together with your models:
git add GOcontroll-Simulink
git commit -m "Update the GOcontroll blockset"
The commit records the new blockset version together with the models that were checked with it.
Moduline S1 models with Use precompiled binary
With the option Use precompiled binary under GOcontroll options, the build of a Moduline S1 model reuses the CodeBase objects of an earlier build from the folder build/codebase_objs/, without checking whether the CodeBase changed. A new model starts with this option. After an update of the blockset, delete the folder build/codebase_objs/ before you build a Moduline S1 model, so that the CodeBase of the new blockset is compiled. With Always recompile the CodeBase is compiled on every build.
Check or undo an update
To see which versions of the GOcontroll Simulink blockset and the GOcontroll CodeBase your project uses, run in the project folder:
git submodule status --recursive
To go back to the version that the project recorded, before you have committed the update, run:
git submodule update --init --recursive
Use this command only to undo an update, not as a step of the update itself: it puts the blockset back on the recorded version.
Models made with an earlier blockset
A model made with GOcontroll Simulink blockset 4.x is not updated with these commands. Version 5 has a different folder layout and one target for all controllers: move the model to a new model made from a template of blockset 5.0.0 or later.
Also see Setup toolchain and Create model.
