- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » [Solved] Loading omlibrary mo-File...
[Solved] Loading omlibrary mo-File fails in a script
[Solved] Loading omlibrary mo-File fails in a script
Dear all,
When I want to load the file /usr/lib/omlibrary/Modelica 3.2.2/Blocks/Math.mo in OMShell-terminal it fails:
>>> loadFile("/usr/lib/omlibrary/Modelica 3.2.2/Blocks/Math.mo")
false
I can, of course, load the file into OME and here it is also possible to export an FMU of one of the blocks (which is my original intent to use script-wise model handling). What did I wrong?
I would really appreciate any kind of hints/help.
Best wishes,
Andreas
Versions:
OMEdit 1.11.0~1-gf048cec
Connected to OpenModelica 1.14.0~dev-5867-g85b17c5
Re: [Solved] Loading omlibrary mo-File fails in a script
ndrsh2 wrote:
When I want to load the file /usr/lib/omlibrary/Modelica 3.2.2/Blocks/Math.mo in OMShell-terminal it fails:
Hi,
I can'not seems to fine a Math.mo file in my Modelica 3.2.2
Code:
loadFile("C:/OpenModelica/lib/omlibrary/Modelica 3.2.2/Math/Special.mo")
Above code loads the Special.mo inside the Math folder and it works. Do you want to load one model or the hole package?
Cheers
- Arinomo23
- 120 Posts
Re: [Solved] Loading omlibrary mo-File fails in a script
Hi Arinomo23,
As a first step I would like to load (and then export) a model, later on, I would like to do this with a package.
I cannot reproduce your test, since I do not have a Math directory, but just Math.mo with 3551 lines of code. This is quite confusing.
Cheers,
Andreas
Re: [Solved] Loading omlibrary mo-File fails in a script
Ahhhh, i see... try to change the directory first and then load the file. For example in my case
Code:
cd("C:/Openmodelica/lib/omLibrary/Modelica 3.2.2/Blocks")
loadFile("Math.mo")
imho it should works
- Arinomo23
- 120 Posts
Re: [Solved] Loading omlibrary mo-File fails in a script
Unfortunately, not. I tried this before (and didn't mentioned it explicitly).
Code:
>>> cd("/usr/lib/omlibrary/Modelica 3.2.2/Blocks")
"/usr/lib/omlibrary/Modelica 3.2.2/Blocks"
>>> loadFile("Math.mo")
false
I have the feeling that files starting with a within-statement cannot be loaded whilst stand-alone models can. If I make a copy of this file and remove the within-statement, it is working.
Why? How can I make it work with within-statement?
Re: [Solved] Loading omlibrary mo-File fails in a script
Code:
loadModel(Modelica,{"3.2.2"})
cd("C:/OpenModelica/lib/omlibrary/Modelica 3.2.2/Blocks")
loadFile("Math.mo")
i forgot that i tested it in OM Compiler CLI. Try above commands in shell, i think now its working.
- Arinomo23
- 120 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » [Solved] Loading omlibrary mo-File...