Creating Instances in Instance Specification Diagrams

Overview

After defining your blocks, you need to create instance specifications for them so that you can use them in your simulation. Instance specifications enable you to set the initial property values for the blocks in your simulation. In this section, you will create an instance specification diagram containing instance specifications for each of the blocks in your Instance Specification Definition Diagram.

This section covers the following concept:

Figure A1: An instance specification diagram

Prerequisites

Prerequisite Description
Behavior Execution Engine Installation You must have installed Behavior Execution Engine.
Tutorial Project You must start this section with the Behavior Execution Engine simulation project from the previous section. If you did not complete the previous section, you can use the following project from the Behavior Execution Engine installation: \documentation\tutorialFiles\01\PropertiesAndOperations.mdzip
Recommended Reading Before completing this section, you may want to read the following help topic:

Instructions

Create an instance specification diagram

To simulate behaviors in Behavior Execution Engine, you need to create instances for the blocks that own those behaviors. You can easily accomplish this by creating an instance specification diagram.

  1. Open the project from the previous section.
  2. In the Containment Tree, right-click the Structure > UAV block and select Tools > Create Instance....
  3. In the 1. Select parts page, expand the computer property, clear the powerSystem property check box inside the computer property to avoid creating an extra PowerSystem instance specification, and click Next >.

    Figure B1: Selecting instance specifications

  4. In the 2. Select a package page, select the Simulation package and click Next >.
  5. In the 3. Create a diagram page, select both the Create a new diagram and Create link between instances check boxes.
  6. In the diagram type box, select Object Diagram.
  7. In the owner for diagram box, select the Simulation package.
  8. In the diagram name text box, enter Instance Specification Diagram, and then click Finish.

    Figure B2: Creating an instance specification diagram

You could drag the simulation instance specification onto this diagram if you want. However, since it is used to execute the simulation rather than being a component of the system being simulated, it more logically belongs on a simulation configuration diagram, as mentioned in the Simulation Configuration section.

Specify the computer's power system

Since the Computer block only references the PowerSystem block rather than owning it, a Computer instance specification could reference any PowerSystem instance specification. When creating the instance specification diagram earlier, you avoided creating an extra PowerSystem instance specification for the uav.computer instance specification, so you should specify that it uses the UAV's power system.

  1. In the Instance Specification Diagram, double-click the uav.computer instance specification to open its specification window and select Slots from the left pane of the window.
  2. In the center pane, select the powerSystem slot and click Create Value.
  3. Select the Simulation > uav.powerSystem instance specification; then click OK and then Close.
  4. (Optional) In the Instance Specification Diagram, drag the uav.referencePoint instance specification into the uav instance specification. The UAV block's inherited referencePoint property could theoretically be independent, but in this tutorial it represents the UAV's center of mass.

    Figure B3: The system instance specifications

  5. (Optional) You may also want to drag the uav instance onto the Simulation Definition Diagram for reference there as well. To do that, drag the element from the Containment Tree onto the Simulation Definition Diagram.
  6. Save your work before continuing.

Next Section >