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

runScript

runScript

Hello!

I am trying to run a script before starting the simulation, so i used at the beginning of my model
function runScript "Runs the mos-script specified by the filename."
  input String filename ;
  output String result;
  external "builtin" ;
  annotation(preferredView = "text");
end runScript;

now my question is: Where do you decline the path of the file i wanna read? or does the OMEdit automatically look in the direction where my main package is saved?

Edited by: Pliskin - Feb-04-14 18:30:03

Re: runScript

runScript will not work during simulation runtime. And the time at which it is evaluated during translation is random as well... There is no way to specify in experiment annotation or similar that a script should be run before simulating.

To read files relative to the library, use modelica:// URLs, see https://build.openmodelica.org/Document … ource.html

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