Page 596 - ExtendSim User Guide
P. 596

570 Libraries and Blocks
Creating and maintaining libraries
Creating a new library
To start a new library, choose Library > New Library. A dialog appears where you can select a location for the new library and give it a name. Libraries should be saved in the ExtendSim9/ Libraries folder so that ExtendSim can quickly find them.
If you build your own blocks or modify ExtendSim’s blocks, you should put them in your own library. Do not put them in the libraries that come with ExtendSim. Otherwise when you install a new version of ExtendSim, you could lose the blocks you built.
Saving and compiling libraries
New Library dialog
Every time you make a change to a library, such as adding a new block or moving a block from one library to another, ExtendSim automatically saves the library. If you build a block and save it, both the block and the library are saved.
When you create blocks using ExtendSim’s ModL programming language, the blocks need to be compiled to machine code so they can be used to build models. If you make a change to an Include file that is used by more than one block, its usually simplest to recompile the whole library so the blocks incorporate the Include file.
Unless you program your own blocks or move a library from one operating system to another (for example, if you move a library from Windows to Mac OS) you do not need to compile. The libraries and blocks that are packaged with ExtendSim are already compiled.
To compile a block or a library, use the compile commands in the Develop and Library menus:
• The Develop > Compile Block command compiles the block to machine code without sav- ing or closing the block. This is useful for testing new code for syntax errors as you are building the block. This command is only enabled when the block’s structure window is the active window.
• TheLibrary>Tools>CompileOpenLibraryWindowscommandcompilesalllibraries whose windows are open and saves the changes. This command is only enabled when at least one library window is the active window.
• TheLibrary>Tools>CompileSelectedBlockscommandcompilesalltheblocksthatare selected in a library window and saves changes. This command is only enabled when a library window is the active window and one or more blocks are selected in the library win- dow.
Compiling a library or block with debugging information allows you to set breakpoints, watch points, and so forth. Compiling with external source code causes ExtendSim to generate an external file that contains the source code; this is useful for version control.
How To


































































































   594   595   596   597   598