Add model instances and change their placement

To specify the functionality of the model you must create a number of model instances and connect them.

Add a model instance

There are different ways to create new instances.

The easiest way to create a new model instance is to select the item in the Library view and drag the item onto the Model Editor Window. A model instance that refers to the model component referenced by the tree view item is created in the model Model Editor Window.

It is possible to copy and paste model instances between different Model Editor Windows. You can select and copy model instances from one Model Editor Window into the clipboard and then paste the contents of the clipboard into another Model Editor Window. If complete connections belong to the selection, they are copied, too. Connections are complete if all the model instances to which the connection is attached were selected.

The third way is to right-click at the position where you would like to create a new model instance. Select the context menu item Add Instance ... to open a Select Model dialog. From this dialog you can select the model component you would like to instantiate in the active Model Editor Window.

By using the Add Model tool button, MLDesigner switches to the block creation mode indicated by a special cursor. In block creation mode, you can create new model instances at the current cursor position wherever you click on the Model Editor Window background. As with the creation of model instances using the context menu a Select Model window is displayed from which you can select the model component to be instantiated. Right-click the mouse to cancel block creation mode or click the tool button Select Tool.

MLDesigner generates a unique name for every created model instance. This name is generated using the physical name, also called “class name”, of the model component and extending it with an integer preceded by a hash (#). On selecting a model instance the Instance Properties plane in the property editor window is activated. The property Name shows the generated name of the model instance. The name is a model instance property that cannot be changed. It is used to identify the model instance uniquely within the hierarchical system model during simulation, see Simulation with MLDesigner.

Setting text label

Instances of model components are labeled by default with the model instance name. Sometimes, the default label of a model instance does not contain enough information about what the instantiated model component does. In that case, it is better to label the model instance with a descriptive text.

The quickest way to add a descriptive label to a model instance is to position the cursor over the existing label and click the mouse two times slowly. The first click highlights the text area with a broken grey border. The second click highlights the text in the text area. You can now type over the existing label. You can use the line breaks within the text area. You will see the model instance expanding to accommodate the text.

When selecting a model instance MLDesigner activates the Instance Properties plane in the property editor window. Select the property Label to add a short description. Click the button to the right of the input field to open a text editor where you can type text labels that need more than one line. If you delete the text in the label property the default label is shown again.

Another method of labeling model instances is to enter the details in the Description field of the Instance property editor. The model instance remains small in the Model Editor Window, and the detailed information is available via tooltip text or online documentation.

Placement of model instances

After the creation of model instances they can be placed anywhere in the model using the drag and drop function. You can copy selected model instances by pressing Ctrl while clicking and dragging the model instance.

Sine modulator example - Step 4