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

Errormessages

Errormessages

Hello community,

I need help with understanding some error messages.

First of all i would like to ask if there is a trick or a special way how to find out what the error message is trying to tell you. Because I find it quite difficult to figure out what the actual error is.

Secondly i would like to ask you guys if you could give me a hint what this error is about:

Error: Variable X.So: In modifier SignalType(redeclare CLASS(SignalType, partial = false, encapsulated = false, prefixes: public redeclare , type, DERIVED(.Real,))
), not processed in the built-in class Real.

Greetings
Pliskin

Re: Errormessages

Hi Pliskin,

Yes, that's a really bad error message. The intended meaning seems to be that you're trying to modify an attribute of a builtin type that doesn't exist, e.g.:

Real x(foo = 4);  // foo doesn't exist in Real.

Would you be able to share a small model that gives this error message? I've already confirmed that I get this error message with a declaration as the one above, but you might have found some other case.

Cheers,
Per

Re: Errormessages

class test
  import WW;
  extends Modelica.Icons.Example;
.
.
.
 
  WW.ASM1.sensor_O2 sensor_O2(So(redeclare type SignalType = Real));
.
.
.

equation
.
.
.
end test;


model sensor_O2
  extends WW.Icons.sensor_O2;
  Interfaces.WWFlowAsm1in In;
  Modelica.Blocks.Interfaces.RealOutput So;
equation
  In.Q = 0;
  So = In.So;
end sensor_O2;



Does this help? It`s a complex model, so i tried to write the important lines down.

Thanks for the fast answer.

Re: Errormessages

Ok, I can't actually see any issues with that code, so it might be that you've found a bug in the compiler. Could you tell me which libraries you are using? I assume that WW is the WasteWater library, but the version of WW linked from modelica.org seems to be a MSL 1.6 library, while your code looks like MSL 2.x.

If you know how to use mos-scripts you could use the saveTotalSCode("filename.mo", modelname) API call to make a total model dump of your model (i.e. a model with all it's dependencies in one file) and upload that to a new ticket on our bug tracker. Otherwise, just tell me the exact versions of the libraries you're using and I'll see if I can replicate the issue myself.

Re: Errormessages

I am looking in to it. Do you have something like a step by step manual for the savetotalscode? I haven't  done it before but i am trying to find out which librarie i am using. It is definetly a newer version, you are right about that.

Re: Errormessages

Sure, just create a .mos-file with something like this in it (substitute names as appropriate):

loadModel(Library1);  // Load any libraries you need, e.g. Modelica, WW, etc.
loadModel(Library2);
loadFile("file.mo"); // Load the file with your model.
saveTotalSCode("model_total.mo", modelname); // Use saveTotalSCode to dump the model to model_total.mo.

Then run it through the OM compiler (omc.exe on Windows, omc on other platforms). If one of the calls fail they usually just return false, in that case you can put getErrorString(); after the failed call to see the error.

Re: Errormessages

Hey there!

It was actually a mistake in the programm. the redeclare for the O2 Sensor was not necessary so we just removed it and now the error i got is gone. and fyi the wastewaterlibrary i am using is already written on 3.2

There are 0 guests and 0 other users also viewing this topic