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.

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
.