- Index
- » Programming
- » Modelica Language
- » Problem with a vector producer
Problem with a vector producer
Problem with a vector producer
model vektor_maker
import L = Modelica.Electrical.Digital.Interfaces.Logic;
parameter Integer Step(start=1023);
parameter Integer Anzahl(start=500);
Modelica.Electrical.Digital.Interfaces.DigitalOutput out[Stufe] annotation(
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)));
initial algorithm
for i in 1:Step loop
out[i]:= L.'0';
end for;
algorithm
if Anzahl <= Step then
for i in 1:Anzahl loop
out[i] := L.'1';
end for;
for i in Anzahl+1:Step loop
out[i] := L.'0';
end for;
end if;
if Anzahl > Step then
for i in 1:Step loop
out[i] := L.'1';
end for;
end if;
equation
end vektor_maker;
- Index
- » Programming
- » Modelica Language
- » Problem with a vector producer