- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » terminal() call
terminal() call
terminal() call
Hello,
the following code:
model test111
Real a(start = 0.1);
algorithm
if terminal() then
a:=1.0;
Modelica.Utilities.Streams.print("terminal", "terminal.txt");
end if;
end test111;
gives me the error:
test111.cpp:734: error: `terminal' was not declared in this scope
Does OpenModelica currently support the terminal() function?
Frank
Re: terminal() call
No, we don't support it properly.
I could alias it to false if you need the code to run (but still not generate the event). I'm adding a ticket here: http://openmodelica.org:8080/cb/issue/1 … ation=true
You can also work around this bug by adding "#define terminal() 0" to OPENMODELICAHOME/include/omc/modelica.h
- sjoelund.se
- 1700 Posts
Re: terminal() call
Yes, constructor/deconstructor is called properly when defined as top-level variables of a simulation.
External Objects work fine for non-array inputs and without any weird call mapping (like trying to send constant expressions...).
- sjoelund.se
- 1700 Posts
Re: terminal() call
What does "top level" mean? I did some tests with a model that contains several blocks (each block has a external object inside).
In my test case the constructor and destructor seems to be called as expected.
Do I run into problems if the bock some were on a deeper model level?
I need a reliable solution because my block might be used somewhere in the model
Re: terminal() call
Not created in a local scope (i.e. inside a function-call).
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » terminal() call