Routines

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 JSR instruction, to call other routines. You can create additional subroutines. The number of routines per program is dependent on the controller memory.
TIP:
MainRoutine
,
Current Routine
,
and
Phase State Routine
are not valid targets as arguments for a JSR instruction, and do not appear in the
Routine
list.
Specify an optional fault routine for each program in each task. The controller executes this routine if it encounters an instruction-execution fault within any of the routines in the associated program.
When creating a project, the MainProgram is already defined for the MainTask. In a Safety controller, the SafetyProgram is already created as well, which has a MainRoutine created. Safety programs only support ladder routines (i.e., no SFC, structured text, or FBD).
Once a routine is created, change its descriptive information.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.