Robotics in Manufacturing

Controller & setup

Configuring a Macro

A macro registers an existing TP program as a single instruction so an operator can trigger it from a teach pendant key, a manual-function menu item, or an I/O signal. This guide covers building the entry on the [6 SETUP, Macro] screen, assigning a device, and running the macro safely. Up to 150 macros can be registered on the controller.

Intermediate~25 min19 steps
  1. Step 1.

    Confirm the target program

    Verify the program that will become a macro runs correctly when selected and started in the normal way. A macro always runs from the first line in continuous mode, so single-step debugging is not available once it is registered.

  2. Step 2.

    Decide whether the macro moves the robot

    A macro program that contains a motion instruction uses a motion group and can move the robot. A macro with no motion group (for example one that only toggles RO or waits on RI) can be started even when the motion-enabled state is not set. Knowing this up front tells you which devices you can assign and which execution conditions apply.

  3. Step 3.

    Set a group mask for a non-motion program (optional)

    If the program only handles I/O and logic, you can give it an empty group mask so it runs without a motion group. On the program information screen (MENU, 1 SELECT, F2 DETAIL), move the cursor to the first field of Group Mask and press F5 (*) to set (*,*,*,*,*,*,*,*).

    Caution: If a motion instruction is already taught in the program, no group mask can be set. Add or remove motion instructions before you try to change the mask.

  4. Step 4.

    Open the macro setting screen

    Press MENU, select 6 SETUP, press F1 [TYPE], then select Macro. The Macro Command screen lists 150 numbered slots, each with an Instruction name, a Program, and an Assign column.

  5. Step 5.

    Enter the macro instruction name

    Move to an empty slot, press ENTER on the Instruction name field, and type the name with the F-key character input. The name must be an alphanumeric string no longer than 36 characters, and no duplicate macro names are allowed.

    Caution: Do not use the parentheses characters in a macro name. Parentheses are reserved for arguments, so a name like HANDOPEN1(HAND1) will cause trouble.

  6. Step 6.

    Select the macro program

    Move to the Program column, press F4 [CHOICE], and choose the target program from the directory. When registered, its subtype changes to MR (macro); if you later clear the entry, the subtype returns to its original value. If you enter a program without a separate macro name, the program name is used as the macro name.

  7. Step 7.

    Understand the device options before assigning

    The Assign column accepts MF[1] to MF[99] (manual-function menu items), UK[1] to UK[7] (user keys), SU[1] to SU[7] (user keys plus SHIFT), DI[1] to DI[32766], RI[1] to RI[32766], UI[7] (the HOME signal), F[1] to F[32766], and M[1] to M[32766]. The total number of DI plus RI assignments is limited to 10. SP[4] to SP[5] appear in the list but cannot be used at present.

  8. Step 8.

    Assign the trigger device

    Move to the Assign column, press F4 [CHOICE], pick the device type from the list, then type the device number. For example, choosing MF and entering 1 assigns the macro to item MF[1] on the manual operation screen.

  9. Step 9.

    Route UI or extra I/O triggers through the correct system variable

    UI[7] is the HOME signal and works as a macro trigger by default. To allocate macros to other UI signals you must enable system variable $MACRUOPENBL, which is changed on the system variable screen displayed at controlled start. Only logical numbers actually mapped to a physical input line will fire the macro.

    Caution: Changing system variables affects controller behavior broadly. Record the original value before you change it and confirm the change with the person responsible for the cell's I/O map.

  10. Step 10.

    Save the macro settings to external storage

    After all macros are set, back up the setting information to external storage such as a USB drive. The current settings can be lost when they are next changed, so an external copy lets you reload them if needed.

  11. Step 11.

    Execute from the manual operation screen

    Press MENU, select 3 MANUAL FCTNS, press F1 [TYPE], and select Macros. Move the cursor to the macro you want, then press and hold SHIFT while pressing F3 EXEC to run it. If the macro commands motion, confirm the cell is clear and all personnel are outside the guard before running it.

    Caution: When the macro contains a motion group, hold SHIFT down until execution finishes. Releasing SHIFT mid-run stops the macro, and pressing EXEC again restarts it from the first line.

  12. Step 12.

    Execute from a teach pendant user key

    A macro assigned to UK[1] to UK[7] runs when you press that user key on its own. A macro assigned to SU[1] to SU[7] runs when you press the user key while holding SHIFT.

    Caution: A macro that uses a motion group cannot run from a plain UK key; it must be assigned to an SU device instead. Assign motion macros to SU so the SHIFT hold acts as a deadman-style confirmation.

  13. Step 13.

    Execute from DI, RI, UI, F, or M

    For signal-driven triggers the teach pendant must be disabled. Drive the assigned input from the external device, or set it directly on the I/O screen, and the macro linked to that signal starts. Before driving the input, confirm the cell is clear and all personnel are outside the guard, since the macro can command motion.

    Caution: A signal-triggered macro can start the robot without a normal cycle-start sequence. Confirm the wiring and interlocks so the signal cannot go active while a person is in the work envelope.

  14. Step 14.

    Call the macro from inside a program

    With the cursor on [End], press F1 [INST], choose 7 MACRO, then pick the macro name from the list. To pass a value, move the cursor after the macro name, press F4 [CHOICE], and select an argument type such as R[ ], a constant, a string, or AR[ ].

  15. Step 15.

    Compare macro lists before copying between controllers

    Before a program registered as a macro is copied onto another controller, compare the macro setting screens of both controllers. Copy the program only when the two lists match, otherwise an unpredictable result can occur.

    Caution: A mismatched macro table can point the same instruction name at a different program on the second controller. Verify the lists match rather than assuming the copy carried the assignments across.

  16. Step 16.

    What can go wrong: a teach pendant key stops doing its old job

    When a user key or key switch is assigned to a macro, it becomes that macro's device and can no longer perform its original function. Check that no macros are unintentionally allocated to user keys before running production.

    Caution: An unexpected macro on a user key can fire during handling and start motion. Review the macro assignments on the setup screen and clear any stray entry.

  17. Step 17.

    What can go wrong: a motion macro will not start

    A macro that uses a motion group only runs when the motion-enabled state is set, which requires ENBL on and the SYSRDY output on (servo power on). If the macro does nothing, check that servo power is up and the enable conditions are met. A non-motion macro does not need the motion-enabled state and can still run.

    Caution: If a motion-disabled or servo-off alarm is present, correct its cause before running the macro. Do not mask or force-clear a safety-related stop to make the macro execute.

  18. Step 18.

    What can go wrong: the macro terminates when SHIFT is released

    During manual-function or SU execution of a motion macro, releasing SHIFT terminates the macro forcibly. Pressing F3 EXEC or the key again restarts the program from the first line rather than resuming.

    Caution: For a macro that leaves the robot mid-path, restarting from the first line can retrace the approach. Confirm the path and clear the area before restarting.

  19. Step 19.

    What can go wrong: a signal trigger does nothing

    If a DI, RI, or UI trigger has no effect, confirm the teach pendant is disabled, since signal execution requires it. Check that DI plus RI assignments have not exceeded the limit of 10, and for UI signals other than HOME confirm $MACRUOPENBL is enabled and the logical number maps to a real input line.

Common questions

How long does Configuring a Macro take?
Configuring a Macro is rated Intermediate and takes about 25 minutes across 19 steps.
What tools do I need?
You will need Teach pendant, External storage (USB) for backing up the macro settings.
What should I do before starting?
The target program to be run as a macro already exists and plays back correctly when started normally. You know whether the target program uses a motion group, since that changes which devices can trigger it and under what conditions. A trigger is available to assign: a manual-function menu item, a teach pendant user key, or a spare DI, RI, UI, F, or M signal.
What is the first step?
Confirm the target program. Verify the program that will become a macro runs correctly when selected and started in the normal way. A macro always runs from the first line in continuous mode, so single-step debugging is not available once it is registered.

Attribution

Procedure steps on this page are checked against the site's editorial safety rules and manufacturer-manual sourcing standards.

Last reviewed: 2026-07-21.

Edited by Mike Ramsey / Reliable Media.Editorial process