AmesimKnowledge

Creating and exporting FMU > The Export Tool in detail

Interface block creation

A Simcenter Amesim model can be exported as an FMU if there is at least one interface block on the sketch. Interface blocks are created in Sketch mode using the Interfaces > Create interface block menu command. It opens the Interface Icon Creation dialog box (see figure below).

Figure 41: The Interface Icon Creation dialog box

In this dialog box, the type of interface has to be chosen from the drop down list.  It must always be set to Functional Mock-up Interface (FMI). Next, the number of input and output ports of the block have to be selected. Since the interface block represents the outside environment of the Simcenter Amesim model, the block input ports carry the output variables of the FMU, and the block output ports carry the input variables of the FMU. You can change these numbers either by typing the required number directly into the two fields or by increasing the value using the spin buttons. When the numbers of input and output ports are set, new fields are automatically inserted on the left (for input ports) and on the right (for output ports) of the dialog box. Input ports are numbered “>1”, “>2”, and so on, while output ports are numbered “1>”, “2>”, etc. Every port must receive a label that is part of the corresponding variable name of the FMU. These port labels can be set automatically by clicking the Auto-set names button. This completes the port fields with labels titled from_ame_1, from_ame_2, and so on for the input port labels and to_ame_1, to_ame_2, and so on for the output port labels (see figure below). The Clear all text button resets all the port label fields. It is however advisable to use meaningful port labels, since these labels are part of the variable names of the FMU, and they are usually visible from the importing environment. The three fields at the center of the dialog box can be left blank or filled in with some text that will be displayed on the icon. This text is solely for display purposes, it is not used in the FMI export process.

Figure 42: The Interface Icon Creation dialog block with automatically set names of port labels

Once the port definition is complete, clicking the OK button closes the dialog box, and a new interface icon is available (see figure below). Its input and output ports can be connected to the signal-type ports of the sensor and actuator components that are used to interface with the model.

Figure 43: A new interface block ready to be added to the sketch

As many interface blocks as required can be created (see figure below). They all declare input and output ports that carry output and input variables. These variables are gathered by the FMI export tool and become the output and input variables of the FMU that are used in the importing simulation software tool to connect the FMU to the signals from the environment. The FMI variable names are built by appending to the port label the name of the interface icon @amesim_interface followed by a number that identifies the block. This way, each variable is identified by a unique name.

Figure 44: An example of sketch with more than one interface block

An interface block can be later changed in Sketch or Submodel mode: right-click the interface block to open a contextual menu (see figure below). In this menu, click the Edit Interface Icon command.

Figure 45: Accessing the Edit interface icon command in the contextual menu of the interface block

This opens the Interface Icon Creation dialog box. In this dialog box, everything can be modified, such as changing the number of input and output ports, or the port labels.

Note

In most cases, models containing interface blocks cannot be run as they are. However, it can be useful to perform some basic checks such as open-loop simulations to see if the configuration of your model is correct; for example to check whether it can locate all its resources (typically tables) and that it initializes correctly. See section Open-loop simulations for basic model checks for more detail on this topic.

Source: https://docs.sw.siemens.com/en-US/doc/254352342/PL20250521841123434.amesim_collection.Functional_Mockup_Interface/xid1223435 · retrieved 2026-07-17