Ticket #6279: TestFMU.mo

File TestFMU.mo, 1.6 KB (added by massimo ceraolo, 4 years ago)
Line 
1model TestFMU
2 parameter Real K = 1;
3 Modelica.Blocks.Interfaces.RealInput u annotation(
4 Placement(visible = true, transformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-118, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
5 Modelica.Blocks.Interfaces.RealOutput y annotation(
6 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)));
7 Modelica.Blocks.Math.Gain gain1(k = K / 2) annotation(
8 Placement(visible = true, transformation(origin = {-60, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
9Modelica.Blocks.Math.Gain gain(k = 1) annotation(
10 Placement(visible = true, transformation(origin = {42, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
11equation
12connect(gain1.u, u) annotation(
13 Line(points = {{-72, 0}, {-120, 0}}, color = {0, 0, 127}));
14connect(gain1.y, gain.u) annotation(
15 Line(points = {{-49, 0}, {30, 0}}, color = {0, 0, 127}));
16connect(gain.y, y) annotation(
17 Line(points = {{54, 0}, {110, 0}}, color = {0, 0, 127}));
18 annotation(
19 Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}), graphics = {Text(origin = {51.5765, 0},lineColor = {0, 0, 255}, extent = {{-147.576, 142}, {48.4235, 116}}, textString = "%name"), Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}})}),
20 Diagram(coordinateSystem(extent = {{-100, -80}, {100, 80}})));
21end TestFMU;