IntegerToReal

block IntegerToReal "Convert Integer to Real signals"
    extends Modelica.Blocks.Icons.Block;

    Interfaces.IntegerInput u "Connector of Integer input signal"
        annotation (Placement(transformation(extent = {
            {-140, -20}, 
            {-100, 20}})));
    Interfaces.RealOutput y "Connector of Real output signal"
        annotation (Placement(transformation(extent = {
            {100, -10}, 
            {120, 10}})));
equation
    y = u;

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    lineColor = {255, 127, 0},
                    extent = {
                        {-120, -40}, 
                        {-20, 40}},
                    textString = "I"), 
                Text(
                    lineColor = {0, 0, 127},
                    extent = {
                        {0, -40}, 
                        {100, 40}},
                    textString = "R"), 
                Polygon(
                    lineColor = {0, 0, 127},
                    fillColor = {0, 0, 127},
                    fillPattern = FillPattern.Solid,
                    points = {
                        {10, 0}, 
                        {-10, 20}, 
                        {-10, 10}, 
                        {-40, 10}, 
                        {-40, -10}, 
                        {-10, -10}, 
                        {-10, -20}, 
                        {10, 0}})}),
        Documentation(info = "<html>\n<p>\nThis block computes the output <strong>y</strong>\nas <em>Real equivalent</em> of the Integer input <strong>u</strong>:\n</p>\n<pre>    y = u;\n</pre>\n<p>where <strong>u</strong> is of Integer and <strong>y</strong> of Real type.</p>\n</html>"));
end IntegerToReal;