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
  • » herlock
  • » Profile

Posts

Posts

May-19-19 17:29:38
passing 'void *' to parameter of incompatible type 'modelica_real'

That seems to have worked, thank you!

For others that might be interested, I used the nightly Linux appliance, found in https://build.openmodelica.org/omc/buil … _machines/, specifically :

https://build.openmodelica.org/omc/buil … 5ee.vdi.gz

May-18-19 23:34:03
passing 'void *' to parameter of incompatible type 'modelica_real'

I'm trying to learn OpenModellica by creating a trivial model in OMEdit, lightly inspired by the PumpingSystem example. However, I'm getting C compilation errors. This feels like a bug to me, but I'm hoping somebody knows the workaround, or can point me to how I would debug this.

My system is just a FixedBoundary connected to a PrescribedPump connected to a FixedBoundary (very short code at the end of this message)

-----------
JonTest4_06inz.c:1456:138: error: passing 'void *' to parameter of incompatible type 'modelica_real' (aka 'double')
  data->simulationInfo->realParameter[6] = mmc_unbox_real(omc_Modelica_Fluid_Machines_PrescribedPump$pump_flowCharacteristic(threadData, mmc_mk_real(data->simulationInfo->realParameter[4])));
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/omc/c/meta/meta_modelica_data.h:231:21: note: expanded from macro 'mmc_mk_real'
#define mmc_mk_real mmc_mk_rcon
                    ^
/usr/include/omc/c/meta/meta_modelica_data.h:225:45: note: expanded from macro 'mmc_unbox_real'
#define mmc_unbox_real(X) mmc_prim_get_real(X)
                                            ^
./JonTest4_functions.h:335:122: note: passing argument to parameter '_V_flow' here
modelica_real omc_Modelica_Fluid_Machines_PrescribedPump$pump_flowCharacteristic(threadData_t *threadData, modelica_real _V_flow);
                                                                                                                         ^
1 error generated.
<builtin>: recipe for target 'JonTest4_06inz.o' failed

----------

model JonTest5
  inner Modelica.Fluid.System system;
  replaceable package MyMedium = Modelica.Media.Water.StandardWaterOnePhase constrainedby Modelica.Media.Interfaces.PartialMedium;
  Modelica.Fluid.Sources.FixedBoundary source(redeclare package Medium = MyMedium, nPorts = 1, T = Modelica.SIunits.Conversions.from_degC(20));
  Modelica.Fluid.Machines.PrescribedPump pump(redeclare package Medium = MyMedium, N_const = 1200, N_nominal = 1200, nParallel = 1);
  Modelica.Fluid.Sources.FixedBoundary sink(redeclare package Medium = MyMedium, nPorts = 1);
equation
  connect(pump.port_b, sink.ports[1]);
  connect(source.ports[1], pump.port_a);
  annotation(
    uses(Modelica(version = "3.2.3")));
end JonTest5;

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