- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Variables in connector
Variables in connector
Variables in connector
Hello,
I am very new to Modelica / OpenModelica. Is there any possibility to list the variables and their types in the connector of a block? How could I find out using OpenModelica Scripting API commands?
E.g. in the p pin and the n pin of a resistor there are the variable voltage v and the flow variable i for the current.
Re: Variables in connector
Yes you can query them using the scripting API,
Code:
loadModel(Modelica);
getComponents(Modelica.Electrical.Analog.Interfaces.PositivePin);
getComponents(Modelica.Electrical.Analog.Interfaces.NegativePin);
Adeel.
- adeas
- 454 Posts
Re: Variables in connector
Thank you very much!!
It seems the function is not documented in the Scripting API documentation. Could you provide me some sort of documentation? Is it nearly the same as the getComponentsTest function? Thanks in advance!!
Hendrik
Re: Variables in connector
Yeah some of the functions are not documented yet.
getComponents takes a model name as input
It returns the list of components where each component is like this record,
Code:
record Component
String className;
String name;
String comment;
String access;
Boolean isFinal;
Boolean isFlow;
Boolean isStream;
Boolean isReplaceable;
String variability "'constant', 'parameter', 'discrete', 'unspecified'";
String innerOuter "'inner', 'outer', 'none'";
String inputOutput "'input', 'output', 'unspecified'";
String dimensions[:];
end Component;
Adeel.
- adeas
- 454 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Variables in connector