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

Modelica.Electrical.Analog.Basic.Resistor not found in scope Moteur.

Modelica.Electrical.Analog.Basic.Resistor not found in scope Moteur.

Hi,

When I try to translate my model into fmu with the OMShell, an error occured:

loadFile("D:/Mes documents/PFE/Moteur.mo")
true

translateModelFMU(Moteur)
[D:/Mes documents/PFE/Moteur.mo:2:3-2:183:writable] Error: Class Modelica.Electrical.Analog.Basic.Resistor not found in scope Moteur.
Error: Error occurred while flattening model Moteur
Error: Internal error SimCode: The model Moteur could not be translated to FMU
[D:/Mes documents/PFE/Moteur.mo:2:3-2:183:writable] Error: Class Modelica.Electrical.Analog.Basic.Resistor not found in scope Moteur.
Error: Error occurred while flattening model Moteur
Error: Internal error SimCode: The model Moteur could not be translated to FMU


Here is my code, but it was automatically generated by Openmodelica from the graphical view so...:

model Moteur
  Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 10) annotation(Placement(visible = true, transformation(origin = {-36, 48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Blocks.Sources.Step step1 annotation(Placement(visible = true, transformation(origin = {-100, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Sources.SignalCurrent signalCurrent1 annotation(Placement(visible = true, transformation(origin = {-58, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
  Modelica.Electrical.Analog.Basic.Inductor inductor1(L = 0.1) annotation(Placement(visible = true, transformation(origin = {20, 48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.EMF emf1 annotation(Placement(visible = true, transformation(origin = {40, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.Rotational.Components.Inertia inertia1(J = 1) annotation(Placement(visible = true, transformation(origin = {100, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Electrical.Analog.Basic.Ground ground1 annotation(Placement(visible = true, transformation(origin = {-8, -28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(ground1.p, signalCurrent1.p) annotation(Line(points = {{-8, -18}, {-58, -18}, {-58, 2}, {-58, 2}, {-58, 2}}, color = {0, 0, 255}));
  connect(emf1.flange, inertia1.flange_a) annotation(Line(points = {{50, 12}, {90, 12}}));
  connect(emf1.n, signalCurrent1.p) annotation(Line(points = {{40, 2}, {-58, 2}, {-58, 2}, {-58, 2}}, color = {0, 0, 255}));
  connect(inductor1.n, emf1.p) annotation(Line(points = {{30, 48}, {40, 48}, {40, 22}}, color = {0, 0, 255}));
  connect(resistor1.n, inductor1.p) annotation(Line(points = {{-26, 48}, {10, 48}}, color = {0, 0, 255}));
  connect(signalCurrent1.n, resistor1.p) annotation(Line(points = {{-58, 22}, {-58, 22}, {-58, 48}, {-46, 48}, {-46, 48}}, color = {0, 0, 255}));
  connect(step1.y, signalCurrent1.i) annotation(Line(points = {{-89, 12}, {-66, 12}, {-66, 10}, {-66, 10}}, color = {0, 0, 127}));
  annotation(Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})), Diagram(coordinateSystem(extent = {{-100, -100}, {100, 100}}, preserveAspectRatio = true, initialScale = 0.1, grid = {2, 2})));
end Moteur;


Thanks for help current/smile

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