When are libraries inserted into a Simulink model?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Jerki Jokne
am 9 Apr. 2019
Beantwortet: Hadi Zyien
am 15 Apr. 2019
Custom library blocks are stored in their own library files, and the model that uses them contains library links to these blocks. As these library blocks are not stored in the actual model, how and when are the inserted into the model? Pre-compile time? During model compilation? I can't find any sources that explicitly say.
I am trying to understand how library blocks work. Are they basically like C macros?
0 Kommentare
Akzeptierte Antwort
Hadi Zyien
am 15 Apr. 2019
You are correct: Library linked blocks do not actually store the library block in the model in which they are used. Rather, the blocks store a link to the source library block. You can see this by looking at a block's 'ReferenceBlock' parameter. Whenever a model is loaded or updated, the links will update.
So yes, you can make the analogy that a library block acts like a C macro (both function-like or object-like, depending on if there are block inputs). A C macro is pre-processed prior to compilation, where all occurances are replaced. Likewise, pre-model-compilcation all library links will be updated.
More information on Libraries can be found here: https://www.mathworks.com/help/releases/R2018b/simulink/ug/creating-and-working-with-linked-blocks.html
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!