This model shows how to use bus signals and structure parameters in an FMU Import block. The FMU supports execution in Model Exchange mode.
This FMU file models a simple system that computes the weighted average of two input bus signals, vehicle
, packed into an array of buses. Each of the input bus signals contains four bus elements, wheel
. Each bus element contains two scalar signals, position
and speed
. The FMU accepts two structure parameters, Weight
and Bias
, and uses them to compute the weighted average ev
of input signals:
ev.wheel(i).position = vehicle(1).wheel(i).position * Weight.v1 + Bias.v1 + vehicle(2).wheel(i).position * Weight.v2 + Bias.v2
ev.wheel(i).speed = vehicle(1).wheel(i).speed * Weight.v1 + Bias.v1 + vehicle(2).wheel(i).speed * Weight.v2 + Bias.v2
where
i = 1...4.
The FMU file supports FMI 1.0 Model Exchange mode.
The FMU Import block supports non-virtual bus types. You must create a bus object whose structure matches the associated structure in the FMU file. When naming the bus object structures, use the variable names defined in the modelDescription.xml of the FMU file. For more information, see FMU documentation.