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.
-
From the Palette Browser, select 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.
-
On the Ports tab, enter the number of input and output
ports you want your custom block to include, enter a name for each port, and
click OK.
-
On the Parameters tab, enter the number of parameters
for the block. For each parameter, enter a name, value and type, and click
OK.
-
On the SimFunction tab, enter the simulation function for your block, and click
OK.