- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » passing 'void *' to parameter of...
passing 'void *' to parameter of incompatible type 'modelica_real'
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;
Re: passing 'void *' to parameter of incompatible type 'modelica_real'
This is an issue with the current front-end. I suggest you use the latest nightly-build:
https://build.openmodelica.org/omc/buil … ly-builds/
and switch on the new front-end: Tools->Options->Simulation->Additional Translation flags: -d=initialization,newInst
You also need to restart OMEdit after setting the flags!
- adrpo
- 885 Posts
Re: 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
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » passing 'void *' to parameter of...