Creating and Editing a Subroutine

You can define a sequence of auxiliary machine motions (such as machining axis changes, PP instructions, machine rotation, or machine instructions), in a machine in a manufacturing program. This sequence is a machining subroutine. Subroutines are stored in the machine itself, but also in the programming representation of the manufacturing cell. This allows you to define subroutines locally and to avoid modifying the machine. Subroutines take parameters as input and are based on IO behavior modeling concepts. Subroutines can also be directly defined in a tool change to define the simulation behavior of the tool change. With this option, NC output is based on tool change syntax, and the PP syntax of the subroutine is ignored. Subroutines generate sub-programs in robot OLP output.


Before you begin: Select a machine or a manufacturing cell in the Activities Process Tree.
  1. From the Programming section of the action bar, click Manage Subroutines .
  2. In the Manage Subroutines panel that appears, click Add to create a new subroutine.
  3. Enter a name for the subroutine, such as Subroutine.X.
  4. Click Edit to edit the subroutine with the Sequencing Editor. For more information, see About the Sequencing Editor.

    Note: When an NC machine subroutine is modified, manufacturing programs running this subroutine must be re-synchronized to take the modifications into account.

  5. In the Sequencing Editor that appears, in the Useable In panel, add the required IO parameters. For more information, see Creating IOs.
    The instruction sequence is displayed.
  6. In the Sequential toolbox, insert sequencing instructions. For more information, see Using the Sequencing Editor.
  7. In the Machining toolbox, insert machining instructions:
    OptionDescription
    Machine Instruction Select the axis joints to move. You can specify:
    • Type of movement: Absolute or Relative.
    • DOF value: Can be a fixed value or one of the double IO inputs defined in the sequence editor.
    • Movement feedrate.
    Tool Attach Specify when to attach the tool.
    Tool Detach Specify when to detach the tool.
    PP Instruction Specify the output instruction.
    Workpiece Attach Attach a manufacturing product onto a machine component. You can specify:
    • Spindle
    • Name of input parameters that indicate the set up position where the manufacturing product is attached.
    • Default index value

    Only available with mill-turn machines.

    Workpiece Detach Detach a manufacturing product from a machine component. You can specify:
    • Spindle
    • Name of input parameters that indicate the set up position where the manufacturing product is detached.
    • Default index value

    Only available with mill-turn machines.

  8. Optional: To delete a subroutine, select it in the list and click Delete .

You can now run the subroutine.