- Index
- » Developer
- » OpenModelica development
- » Scope or instance of variables...
Scope or instance of variables beetween to blocks embeded in a model
Scope or instance of variables beetween to blocks embeded in a model
Hi all,
I have created a block PT (pressure transmitter) to give the measure of fluid pressure with some options.
It can deliver absolute pressure as bar a or effective pressure as bar g ( = absolute pressure - atmospheric pressure )
When I put on the graphical sheet of Omedit model a system block, I can then use the global variable system.p_ambient everywhere.
In the definition of PT block, I have the line:
type Press = Real(final quantity = "Pressure");
parameter Press Ambient_Pressure = system.p_ambient "Pressure reference (Pa a)";
(or .system.p_ambient)
That causes a compilation error (unknown variable), but if I enter system.p_ambient in instanced object it runs well.
As well, there is no error with a constant like parameter Press Ambient_Pressure = 101325 "Pressure reference (Pa a)";
An idea ?
/Bruno
- Brunad
- 10 Posts
- Index
- » Developer
- » OpenModelica development
- » Scope or instance of variables...