164 Rockwell Automation Publication 1756-UM001M-EN-P - February 2012
Chapter 10 Develop Applications
Routines
A routine is a set of logic instructions in a single programming language, such as
Ladder Diagram (ladder logic). Routines provide the executable code for the
project in a controller. A routine is similar to a program file or subroutine in a
PLC or SLC processor.
Each program has a main routine. This is the first routine to execute when the
controller triggers the associated task and calls the associated program. Use logic,
such as the Jump to Subroutine (JSR) instruction, to call other routines.
You can also specify an optional program fault routine. The controller executes
this routine if it encounters an instruction-execution fault within any of the
routines in the associated program.
Figure 31 - Routines in a Control Application
Figure 32 - Routines in RSLogix 5000 Software
RSLogix 5000 Control Application
Controller Fault Handler
Task 8
Task 1
Configuration
Status
Watchdog
Program 32
Program 1
Main Routine
Fault Routine
Program (local)
Tags
Other Routines
Controller (global)
Tag s
I/O Data System-shared Data