model Ctr "controller"
input SignalBlocks.InputPin i1 "Signal Input" annotation(Placement(
transformation(extent={{-105,55},{-95,45}}),
iconTransformation(extent={{-120,30},{-80,70}})));
input SignalBlocks.InputPin i2 "Signal Input" annotation(Placement(
transformation(extent={{-120,-70},{-80,-30}}),
iconTransformation(extent={{-120,-70},{-80,-30}})));
output SignalBlocks.OutputPin o1(start=-1) "Signal Output" annotation(Placement(
transformation(
origin={96,0},
extent={{-19.3,-20},{20.7,20}},
rotation=180),
iconTransformation(
origin={96,0},
extent={{-19.3,-20},{20.7,20}},
rotation=180)));
Integer var1(start=-1) "Variable";
algorithm
// enter your equations here
when i1==true then
var1:=-1;
end when;
when i2==true then
var1:=1;
end when;
equation
o1=var1;
annotation(Icon(
graphics={
Rectangle(
fillColor={255,255,255},
fillPattern=FillPattern.Solid,
extent={{-90,80},{86.7,-80}}),
Text(
textString="Ctr",
extent={{-66.7,23.3},{60,-36.7}})}));
end Ctr;