Jack
Jack

Reputation: 1232

How to add marks for new connections in the expandable connectors?

I got a model that uses the expandable connector as a signal bus, there are marks for each signal line, but when I connect a new block component to the signal bus, there is no mark.

My question is : How could I add marks for new connections? I have checked, the marks are not text labels.

enter image description here

Upvotes: 0

Views: 64

Answers (1)

Markus A.
Markus A.

Reputation: 7525

The "label" for the connection is actually an annotation of the connection itself. It is can (optionally) be added when a connection to an expandable connector is created. See the screenshot below, especially the part marked in red.

Dymola's Create Connection UI

What this results in is an annotation for the connection:

  connect(gain.u, controlBus) 
    annotation (
      Line(points={{-38,80},{16,80},{16,10},{30,10}}, color={0,0,127}), 
      Text(string="%second", index=1, extent={{6,3},{6,3}}, horizontalAlignment=TextAlignment.Left));

The interesting part for the label being the Text(...). If I remember correctly, the string can be either %first or %second and describes which connector's name will be used for the label. The index is used to determine the point in the connection to which the label is attached, extend defines the placement.

The model used to show this is Modelica.Blocks.Examples.BusUsage.

Upvotes: 3

Related Questions