Page 598 - ExtendSim User Guide
P. 598

Libraries and Blocks
Working with blocks
blocks, use the Library > Tools > Protect Library command. This process creates a duplicate of the library, with all the source code removed. Keep the original library in a safe place, since there is no way to recover the ModL source code from the protected library.
☞ To protect a hierarchical block's structure and prevent a user from double-clicking the hierar- chical block to see the underlying submodel, use the Model > Lock Model command discussed at “Locking the model” on page 800.
A protected library can be used in the same way as any other library except that the ModL code cannot be altered or viewed. This means that someone using the library has all the functionality of the blocks in that library but no ability to see how the blocks work.
☞ To keep a library from being used to build models, while still allowing it to be used to run sim- ulations, see “Convert Library to RunTime Format” on page 823.
Converting libraries to RunTime format
As discussed at “The ExtendSim LT version” on page 801, the ExtendSim LT-RunTime ver- sion is useful for distributing models to those who do not have a full ExtendSim license. To have your custom libraries be available to run models in the LT-RunTime version, but not available to build models, convert them to RunTime format. Converting libraries to RunTime format also prevents them from being used in the full version of ExtendSim. The conversion process is described in “Convert Library to RunTime Format” on page 823.
Working with blocks
ExtendSim blocks have a user interface (their icon, dialog, and help) and internal, integrated ModL code that determines how the blocks behave.
Blocks are stored in repositories called libraries. The entire definition for a block (its pro- gram, icon, dialog, and so on) is stored in the library. When you include a block in a model, the block itself is not copied to the model. Instead, a reference to the block is included in and stored with the model. Any data you enter in the block’s dialog is also stored within the model.
Customizing block icons
The blocks in the libraries that come with ExtendSim (such as the Value and Plotter libraries) are displayed on the screen as icons that depict their function. Once you place a copy of these blocks in your model, you might want to make its icon more closely indicate its role in your particular model. However, using programming to change a block’s icon in one model will change it in every model using that block, since blocks and their internal descriptions reside in libraries, not in models. In addition, since some blocks are animated, it is not easy to change a block’s icon without having to modify its ModL code. For these reasons, you should not change the icon on the blocks in the libraries that come with ExtendSim.
If you build your own blocks, you can give them any icon you want. However, there are two better ways to customize blocks in your model without having to directly modify icons:
• You can paste pictures on the worksheet to customize the model. Pictures automatically go behind blocks and text. For example, you can place a map of a region behind your model, or show the layout of a plant. This is described in more detail in “Working with pictures” on page 640.
• Youcanalsoaddapicturetoablockwithoutaffectingtheoriginaloneinthelibrarybymak- ing the block hierarchical. This technique is described in more detail in “Modifying hierar- chical blocks” on page 627.
How To

   596   597   598   599   600