Compiling and Updating a Project to Add a Modelica Model and Component

Once the entity description and all architecture descriptions of a model are completed, the model is ready to be compiled and added to the Twin Builder project as a component.

You can update a project to both compile your Modelica model and create a component as follows:

  1. Select Modelica Model Editor > Compile & Update Project.
  2. After model compilation, select the model interfaces you want to expose in Twin Builder. See Selecting Component Interface.

    Note:

    Select the Don't show interface selection during compilation check box to skip this step in future compilations. To reenable this step, open the Options dialog box, select Model Editor > Modelica > General, and select the Show model interfaces dialog during compilation check box.

  3. The Import Components dialog box appears listing all of the models in the current Modelica Model project on the Models tab.
    Note:

    Select the Don't show again and update component everytime check box to skip this step in future compilations. To reenable this step, open the Options dialog box, select Model Editor > Modelica > General, and select the Show update component dialog after compilation check box.

  4. See Importing and Updating Twin Builder Models and Components for detailed information on settings you can make in this dialog box. When finished, Twin Builder compiles the Modelica model source code.
    • If the compiler detects an error or issues a warning, it is displayed in the Message Manager pane and will identify the line number of the statement that caused the error or warning. Press Ctrl+G to open the Go To Line dialog box to go to the line.
    • If the compilation of the Modelica Model succeeds, a message appears in the Message Manager pane indicating that the project update was successful.
    • A component for each model appears in the Project Manager Component Definitions folder. The new models also appear in the list of Project Components from which they can be placed onto a schematic for simulation.

Use External Solver

You can select this option under Modelica Model editor or from the Modelica ribbon. When selected, the compiled model uses an external solver during co-simulation; the following properties are added to the created component:

The above three properties control the usage of the external solver for the model.

Initialization of Input Values

Initial values of inputs can be specified using two ways:

The first option is the default option and is appropriate if the source of the input is from constant blocks, FML_INIT block, timer function components, and so on. However, if the input is connected to a quantity that depends on other components, it could lead to initialization failure due to improper initial values. Specifying the initial conditions for the inputs (the second option) is always the preferred way to initialize the model. The start parameters have the same name of the input plus _start suffix.

Related Topics 

Importing and Updating Twin Builder Models and Components

Using the Modelica Model Editor