Define the ports, parameters and simulation function for a MoCustomComponent
block.
-
From , select ActiveRC.scm.
The model opens in a new window.
-
From , drag and drop one MoCustomComponent block
outside of the main diagram, and double-click the block.
The block dialog appears with tabs to define the ports, parameters and
simulation function for the block.
-
On the block dialog, select the tab, Ports, and enter
the information to define one input and one output port as you see in the
following figure:
Important: Reviewing the Modelica MO code will help you understand
what ports are required for the component.
-
On the block dialog, select the Parameters tab. For
Number of parameters, enter 1. For Name, enter
'R', and for Value, enter
R.
-
On the block dialog, select the tab, SimFunction.
Note: Writing the simulation function requires some knowledge of the Modelica
language and how it inherits (extends).
-
On the SimFunction tab:
The Modelica Custom Component block is defined and ready to be connected
to the model.