Modelica Custom Block

Define components and Modelica blocks with the MoCustomComponent block.

The Modelica Custom Component block is available for defining an implicit component with Modelica language. The block is fully customizable including its ports, parameters and simulation function. The block lets you leverage any existing Modelica code to create a new component or modify an existing Modelica block.
  1. From the Palette Browser, select Activate > CustomBlocks > MoCustomComponent block. Drag and drop the block into your diagram and double-click it.
    The block dialog appears with tabs to define the Ports, Parameters and SimFunction for the block.
  2. On the Ports tab, enter the number of input and output ports for the block, enter a name for each port, then click OK.
  3. On the Parameters tab, enter the number of parameters for the block. For each parameter, enter a name, value and type, and click OK.
  4. On the SimFunction tab, enter the simulation function for your block, then click OK.