1 | package FMUissue
|
---|
2 | model Gain
|
---|
3 | parameter Real K=2 "Guadagno";
|
---|
4 | Modelica.Blocks.Interfaces.RealInput u annotation(
|
---|
5 | Placement(visible = true, transformation(origin = {-118, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-118, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
|
---|
6 | Modelica.Blocks.Interfaces.RealOutput y annotation(
|
---|
7 | Placement(visible = true, transformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
8 | Modelica.Blocks.Math.Gain gain1(k = K) annotation(
|
---|
9 | Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
10 | equation
|
---|
11 | connect(gain1.y, y) annotation(
|
---|
12 | Line(points = {{12, 0}, {104, 0}, {104, 0}, {110, 0}}, color = {0, 0, 127}));
|
---|
13 | connect(gain1.u, u) annotation(
|
---|
14 | Line(points = {{-12, 0}, {-106, 0}, {-106, 0}, {-118, 0}}, color = {0, 0, 127}));
|
---|
15 | end Gain;
|
---|
16 |
|
---|
17 | model Test
|
---|
18 | Modelica.Blocks.Sources.RealExpression realExpression(y = 1) annotation(
|
---|
19 | Placement(visible = true, transformation(origin = {-54, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
20 | FMUissue_Gain_me_FMU fMUissue_Gain_me_FMU(gain1_k = 4) annotation(
|
---|
21 | Placement(visible = true, transformation(origin = {-8, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
---|
22 | equation
|
---|
23 | connect(fMUissue_Gain_me_FMU.u, realExpression.y) annotation(
|
---|
24 | Line(points = {{-18, 0}, {-44, 0}, {-44, 0}, {-42, 0}}, color = {0, 0, 127}));
|
---|
25 | protected
|
---|
26 | annotation(
|
---|
27 | uses(Modelica(version = "3.2.3")),
|
---|
28 | Diagram);
|
---|
29 | end Test;
|
---|
30 | annotation(
|
---|
31 | uses(Modelica(version = "3.2.3")));
|
---|
32 | end FMUissue;
|
---|