Suppose there is a line object and text object in graph window and their names are Line and Text respectively. (You can go to Programming tab of the Object Properties dialog to check the name)
Run the following Labtalk script to connect two objects. The child object (Text) is linked to parent object (Line).
Line.connect(Text, 0, 17, 0, 35)
2. Right click Text object and open Properties dialog to set relative position to Line object.