Create a routine
Use the
New Routine
dialog box to break up large or complex program logic into multiple routines, such as a main routine, a fault routine, and a subroutine. After creating routines you must schedule their execution in the program or phase.
To break up logic into multiple routines:
- Right-click the selected program in theController Organizerand then chooseNew Routine.
- In theNamebox, enter a name for the routine.
- In theDescriptionbox, enter a description of the routine.
- From theTypelist, select the type of routine you want to create. Choose from the following:
- Ladder Diagram
- Sequential Function Chart
- Function Block Diagram
- Structured Text
- From theIn Program or Phaselist, select the program or phase in which the routine will reside.
- From theAssignmentlist, select the assignment for the routine. Choose from the following:
- <none> -- No special assignment for the routine. These routines are executed when called by a JSR instruction from another executing routine in this program.
- Main – Designates this routine as the Main routine in the program, which is initially executed by this program.
- Fault – Designates this routine as the Fault routine in the program. This routine is executed when a major fault occurs in this program or equipment phase.
- Prestate – Designates this routine as a Prestate routine in an equipment phase. This routine is executed by this equipment phase before the execution of any of the other state routines.
- (optional) Select theOpen Routinecheck box to open the routine in the editor after it is created.
- SelectOKto create the routine. The routine appears in theController Organizerunder the program or phase you chose.
Provide Feedback