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
  • Index
  • » Users
  • » rettifan
  • » Profile

Posts

Posts

May-23-11 22:40:48
need a predefined macro for a external c function

Hi,
is there a "predefined macro" in OpenModelica which can be used in a external function.

Frank

May-10-11 10:53:49
How to pass a real array to a external c-function
Category: Developer

thanks

May-10-11 08:16:57
How to pass a real array to a external c-function
Category: Developer

Hi,
I need to pass a Modelica (real) array to a external object. The function looks like this:

function addSurfaceObjectData "addSurfaceObjectData"
  input Blender.Types.SurfaceObject component;

  input Real[:,:] X;
        ...
  external "C" addSurfaceObjectData(component, X);
end addSurfaceObjectData;

The corresponding c-function is something like:
void addSurfaceObjectData(void* object, double * x_array) {..

As far as I remember, this is currently not implemented in OpenModelica. Is that right?
Is there any workaround?

Frank

May-05-11 16:26:25
Topic: OMEdit
"defaultComponentName" annotation does not work

If I add a new component which has the "defaultComponentName" annotation the default name is not used.

May-04-11 19:59:37
terminal() function gives me an error

ok

May-04-11 19:44:19
terminal() function gives me an error

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

May-04-11 15:30:08
terminal() function gives me an error

Thanks for the work around, but I need to write a text file after the simulation to export some data.

Could I use the "destructor" of a external object as a work around?

May-04-11 15:07:23
terminal() function gives me an error

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

Hi,
I need to pass a string to a external c-function under windows. The string contains special characters like \n for a new line. If I Write the characetr to a text file, the two characters \n appear in the text file (and not the expected new line).

My questions:
How does OpenModelica treat special characters like \n?
Which string would give me the new line?

Frank

Mar-24-11 13:14:47
Annotation syntax that works for SimX, Dymola and OpenModelica

thanks, I'll cleanup my code.

As far as I remenber you told me, that the "LibraryDirectory" and "IncludeDirectory" annotations are currently not supported.
Is the implementation of these two annotations already on the todo list?

Frank

Mar-18-11 11:07:04
Annotation syntax that works for SimX, Dymola and OpenModelica

Hello List,
I'm working on a model that includes a „external object“. The task is to find a implementation that works for Dymola, SimulationX and Open Modelica. I currently have the following annotation syntax to include the c-code:

annotation (
       dll="eobj.dll",
       Include="#include <eobj.c>");

The annotation "dll="eobj.dll" is used by SimulationX and Dymola can process the "Include=#include <eobj.c>" statement. Unfortunately OpenModelica doesn’t accept this syntax.

My question:
Is there a annotation syntax for OpenModelica, that doesn’t affect the behaviour in Dymola and SimX (Maybe I can tweak the annotation a bit, so that it works for all three applications)


Best Regards,
Frank

Jan-09-11 21:52:59
MSL 3.1 extends ModelicaServicesLibrary

Hello all,
I 'm using OMEdit 1.6 with MSL 3.1. Some models of the MSL 3.1 extend the new ModelicaServices Library, but I can't find the ModelicaServices in the library browser.

My question:
How does OpenModelica consider the "Modelica Services Library"?

Best regards,
Frank

Nov-10-10 12:30:50
"External Objects" in OpenModelica?

Hello all,
I have some libraries developed with SimulationX and Dymola which I would like to use with OpenModelica.

My Question: Does OpenModelica currently support "External Objects"?
If yes, can anyone provide an example?

Best Regards,
Frank

  • Index
  • » Users
  • » rettifan
  • » Profile
You are here: