Run a user program continuously

This topic explains the steps to take to make sure a user program will always run.

  1. Make the User Program Loop
    Use a Link Type that jumps back to the step where you want the loop to begin. If the program has only one step, the Repeat label will work, since it repeats that step. For example:

  2. Start Controller in Run Mode

    1. In the Project pane, right-click Programming and choose Properties.
    2. On the Run/Program page, set the Startup Mode to Start controller in RUN.
    3. As always, remember to download the changes and update Flash.
  3. Start the User Program When the RMC Starts Up
    In the Program Triggers, make a condition that starts the user program when the _FirstScan tag is true. This tag is true during the first loop time after the RMC enters Run mode. For example:

  4. Set User Program to Not Stop When an Axis Halts
    By default, all tasks will stop when any halts. You must change this if you want the user program program to run even if an axis halts:

    1. In the Project pane, right-click Programming and choose Properties.
    2. On the Halts page, choose either Stop No Tasks or, choose Stop the Following Tasks and uncheck the task you plan on running the user program on.
  5. Make Sure RMC Does Not Go into Program Mode
    If the RMC enters program mode, the user program will stop. Make sure you do not put the RMC into Program mode while the RMC is running.

  6. Download and save to Flash
    Before you cycle power to test that things are working, make sure to Update Flash so the controller loads your new settings when it powers up.

    1. From the Controller menu, select Download All to Controller
    2. From the Controller menu, select Update Flash