Page 597 - ExtendSim User Guide
P. 597

Libraries and Blocks 571
Creating and maintaining libraries
☞ Blocks with debugging code show in the library window with their names in red and show in a model window with a red border around their icon. Blocks with external source code will show in the library window with CM (code management) next to their icons.
For more information about saving and compiling libraries, see the Developer Reference.
Substituting one library for another
If you create your own blocks, you might want a model to use the blocks from a library with a different name. For example, if you have developed a newer version of a library and you want the model to use those blocks. Normally ExtendSim opens the library too fast for you to stop it.
In order to bypass this process, you can choose to not have ExtendSim automatically find and open libraries when a model opens. You do this by deselecting the Automatic search option in the Edit > Options > Libraries tab. If you do this before opening a model, ExtendSim will stop and request the location of each library the model uses. You can then use the dialog to find and open the libraries you want the model to use. This will work even if the library name is dif- ferent than the one the model originally used, because what is important to the model is the block name within the library, rather than just the library name.
Once all the required libraries are open, save the model. So that the model will again open the libraries automatically, go to the Edit > Options > Libraries tab and select Automatic search before reopening the model.
Arranging blocks in libraries
If you build your own blocks, you could put all of the blocks you use (up to the 200 block limit) in one huge library. That way, you would never have to try to remember which block was where or remember where your libraries are on your hard drive. However, this arrangement could make it difficult to maintain your blocks.
☞ Simulations run neither faster nor slower when you group your blocks in a single or multiple libraries. The only performance consideration is that it initially takes more time to open multi- ple libraries than it does a single library.
There are typically three classes of libraries you might want to create: general-usage, subject- specific, and model-specific.
• General-usagelibrariesholdblocksthatmightbeusedinawidevarietyofmodels.
• Subject-specific libraries are for blocks that are only relevant to one subject, such as paper making.
• Model-specific libraries hold blocks that are only used in a single model.
Do not add blocks to the libraries that come with ExtendSim or move blocks from those librar- ies. If you add blocks to an ExtendSim library, your work will be lost when you update. If you move blocks from an ExtendSim library to a library you create, the blocks in your library will not be updated when the ExtendSim library is updated.
Protecting the code of library blocks
If you build your own blocks, you may not want others to have access to your code. As dis- cussed in the Developer Reference, ExtendSim blocks contain ModL code and can also refer- ence Include files.
You can prevent others from accessing the code in your libraries by 1) not giving them the Include files and 2) removing the ModL code of the blocks. To remove ModL code from your
How To


































































































   595   596   597   598   599