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:
  1. Right-click the selected program in the
    Controller Organizer
    and then choose
    New Routine
    .
  2. In the
    Name
    box, enter a name for the routine.
  3. In the
    Description
    box, enter a description of the routine.
  4. From the
    Type
    list, select the type of routine you want to create. Choose from the following:
    • Ladder Diagram
    • Sequential Function Chart
    • Function Block Diagram
    • Structured Text
  5. From the
    In Program or Phase
    list, select the program or phase in which the routine will reside.
  6. From the
    Assignment
    list, 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.
  7. (optional) Select the
    Open Routine
    check box to open the routine in the editor after it is created.
  8. Select
    OK
    to create the routine. The routine appears in the
    Controller Organizer
    under the program or phase you chose.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.