Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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;

There are 0 guests and 0 other users also viewing this topic
You are here: