Connect an FMU to the Model

Inputs and Outputs connect the FMU to the Model. FMU Inputs are Model measures (defined as Model state- and time-based expressions). FMU Outputs are typically referred to by force or motion generating entities contained in the Model.
  1. Provide solver expressions for each of the channels under the Value column of the Input tab.
  2. Define the FMU Outputs. These are referenced by Force or Motion entities in the Model.
    The expression for the Forces/Motions in the Model use the ARYVAL function to reference the FMU outputs. The FMU outputs are available as attributes to the y_array data member of the FMU entity. For instance, {fmu_1.y_array.output_3}, will contain the third output of the FMU.

    Figure 1. Force expression referring to an output of an FMU

    In the above model of a quadcopter, the vehicle position and velocities captured by the solver expressions DX(), DY() etc. are provided as inputs to the FMU. The output from the FMU is tapped using the output attributes of the y_array data member of the FMU that was resolved to the solver expression ARYVAL. In the demonstrated case, the motion on one of the blades uses the second and the third output. The expression {fmu_controller.y_array.output_2} returns the second output from the FMU’s (fmu_controller) output array (y_array).