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

How to read in parameters ?

How to read in parameters ?

I want the simulation (named "Paramread") to read a parameter (a number) from my test.txt
and I used readreelParameter, and it worked.
But when I started the Paramread.exe and changed the number in the test.txt, the old number stayed in the new parameter_res.csv .

model paramread
  Modelica.SIunits.Mass m = Modelica.Utilities.Examples.readRealParameter("test.txt", "Masse") annotation(uses(Modelica(version = "3.2.1")));
  Modelica.SIunits.Area A = Modelica.Utilities.Examples.readRealParameter("test.txt", "Flaeche");
  annotation(uses(Modelica(version = "3.2.1")));
end paramread;

How can I read in the parameters so that the Paramread.exe reads in the new numbers with every start and doesn't keep the old ones?

There are 0 guests and 0 other users also viewing this topic