Creating Modules

You can create a module either by creating a model, saving it, and then importing it into a module; or by creating and building a module directly within a model. Both procedures are described below.

To Create a Module by Importing a Model

  1. Create a model that you want to import as a module.
  2. Define the model as you would any other model, but also define its module inputs and outputs.
  3. Save the model.
  4. Import the saved model into the module.

To Create a Module from Within a Model

  1. Open or create the model you want to create a module in.
  2. On the Build toolbar, click the tool.
  3. Click the diagram to add the module to the model.
  4. Name the module variable like you would any other variable. For more information about placing, naming, and editing modules, see Working with Building Blocks.
  5. Double-click the new module variable. A blank model window will appear.

  6. Build the module as you would any model.
  7. Save your changes as you work by choosing Save from the File menu. This saves all changes you made to the top-level model and any modules in the model.

    Note: By default, modules are saved in the model file. To save a module in a separate file, select the Save in separate file check box on the Module Properties panel. For more information, see Setting Module Properties.

  8. Repeat this procedure to add as many modules as you need to the model.

    You can add modules to the top-level model, or to any other modules within the model, by navigating to the module you want to add another module to.

    Tip: To navigate from the module to another level in the hierarchy, click to navigate up one level, or click to go to the top level.

When you've finished creating a module, define the module inputs and outputs, and then assign the module inputs. The model, as a whole, can't run until all module inputs have been assigned (each module, though, can run in isolation). For more information, see Running Modules.

Note: After you've created a module, you can also add a picture to appear on a module's icon, password-protect the module, and select whether you want to save the module in a separate file from the model. For more information, see Setting Module Properties.

Concept Link IconSee Also