This topic explains the steps to take to make sure a user program will always run.
-
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:
-
Start Controller in Run Mode
- In the Project pane, right-click Programming and choose Properties.
- On the Run/Program page, set the Startup Mode to Start controller in RUN.
- As always, remember to download the changes and update Flash.
-
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:
-
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:- In the Project pane, right-click Programming and choose Properties.
- 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.
-
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. -
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.- From the Controller menu, select Download All to Controller
- From the Controller menu, select Update Flash