Closed thorade closed 1 year ago
It seems that Modelon Impact expects external code to use ModelicaMessage etc, but ExternalMEdia is using stdout for communication, and Impact does that, too.
This could be fixed on either library or tool side. Modelon compiler team will fix it on the tool side, so there is nothing to do here. Closing this. Will put a comment once it is fixed
@thorade the code we wrote uses ModelicaMessage
etc., but the code we used, i.e. CoolProp
, uses stdout
, or maybe even cout
. Ideally, we'd like to keep it as it is. I'm not aware of limitations in Modelica external functions that forbid using stdout.
Of course errors and exceptions are different: in that case, you really need to catch them and pass them properly to ModelicaError
, so that the runtime can take appropriate action (e.g., retry with a shorter time step).
BTW, doing that is currently a pain, and required a quite convoluted hack to work in all OSs and tools. I would very much appreciate your comment on modelica/ModelicaSpecification#2191, on behalf of Modelon, so we can push that forward.
If we can reach an agreement on a standard way to export ModelicaUtilities symbols in all tools, we could simplify the code of ExternalMedia considerably. In fact, the ExternalMedia source code is ready for that, we would only need to remove parts that are no longer necessary.
I am testing the library with Impact, and after changing some comments to C89 format (see PR #79) and compiling the source code to .so file I am able to simulate some of the smaller models like
ExternalMedia.Test.TestMedium.TestConstants
But for several of the "real" models like
ExternalMedia.Test.CoolProp.Pentane.Pentane_hs
I receive an error message as below:Any idea what I am doing wrong?