Skip to content

Build subprograms with outputs

What you will learn

  • Create a program which returns output parameters.
  • Use the program as a subprogram in another program.
  • Use the output parameters of the subprogram as input parameters of a function block.

This tutorial will explain how to build a program producing a position as output which will be used in other program as subprogram.

Create the subprogram

  1. Create program which consists of one Get Flange Pose function block.
  2. Select Set Parameter on the function block.
  3. Press the link-button Link all values button next to Pose.
  4. Create a new output parameter under Parent Program Outputs by entering a name and pressing the add-button Add-button.
  5. Link the pose to the output parameter by clicking the tick tick-button.
  6. Save the program.

Use the subprogram

  1. Create a program which consists of the previous program as a subprogram followed by a Move Cartesian function block.
  2. Select Set Parameter on the Move Cartesian function block.
  3. Switch to the Parameter Editor by clicking parameter_editor-button on the top right.
  4. Click triple_dots-button the three dots next to Pose Reference to expand the options.
  5. Now press the link-button Link all values button next to Pose Reference.
  6. Select the pose output of the subprogram under Outputs of other function blocks by clicking the tick tick-button.
  7. Now enter appropriate values for Speed and Acceleration and values for the Goal Pose.
    e.g. Position = [0, 0, -0.1] and Orientation = [0, 0, 0] moves the robot up by 100 mm.
  8. Running the program now moves a robot relative to the flange pose of the robot.