I plan to show a variable's quantity in a text string, so I checked the usage of DynamicSelect expression in Modelica Specification, as shown below:
Here is an example I make, it only contains one Modelica.Blocks.Sources.Sine component and a text label, but I am not sure why the text doesn't change during the simulation. It seems like the DynamicSelect expression doesn't work at all.
My question is:
How should I set the DynamicSelect expression to make it work?
model fsdaf
Modelica.Blocks.Sources.Sine sine(amplitude=100, freqHz=1)
annotation (Placement(transformation(extent={{-124,-10},{-104,10}})));
equation
annotation (Diagram(graphics={
Text(
extent={{-22,60},{98,10}},
lineColor={28,108,200},
fillColor={238,46,47},
fillPattern=FillPattern.None,
textString=DynamicSelect(10,string(sine.y)))}),
uses(Modelica(version="3.2.3")));
end fsdaf;
question from:https://stackoverflow.com/questions/65853621/how-to-set-the-dynamicselect-expression-in-modelica-models