Help - Search - Members - Calendar
Full Version: getting component names
Modelica Forum > Modelica > Modelica
Matthias Kirchner
Hi All,

i'm trying to implement a model wich posts warning messages to the log.
To send a message i use Modelica.Utilities.Streams.print. This works fine so far.

But now i'd like to post the components name which caused the warning.

Example:


when x>y then
Streams.print("Warning: x>y in component componentname!");
end when;



In a textfield (Iconview) it is possible to figure out the name by using "%name". But this isn't working in this case.

Does anyone have an idea?

thanks,
Matze

P.S. I'm using Modelica 2.2.2






Roland
Hello Matthias,

sorry, but this is not possible in Modelica.
It has been in discussion several times, but so far there is no solution. A (inconvenient) workaround (which I guess you are using) is a string parameter which you can use in your message.

Roland
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.