Create a routine

Create a routine to break up a large or complex program into multiple routines, such as a main routine, a fault routine, and a subroutine. By default, each program contains one, and only one, main routine. Create up to 1000 routines.
  1. On the explorer bar, select System Icon
    System
    and expand the FactoryTalk Smart Objects.
  2. Right-click the program and select
    New routine
    .
  3. In
    New routine
    , in
    Name
    , enter a name
    for the routine.
  4. (optional) In
    Description
    , enter a description of the routine.
  5. Configure the routine as either:
    • Main routine. Under
      Select as Main Routine
      , position the switch to Toggle On Position
      On
      to make the routine a main routine and execute the logic in a routine when a program triggers. Position the switch to Toggle Off Position
      Off
      to make the routine a fault routine.
      IMPORTANT: All main routines must use the Name
      main
      . Changing the name of a main routine after it has been created removes its designation as a main routine.
    • Fault routine. Under
      Select as Fault Routine
      ,
      position the switch to Toggle On Position
      On
      to make the routine a fault routine and execute fault handling logic when a program fault occurs. Position the switch to Toggle Off Position
      Off
      to make the routine a main routine.
  6. In
    Routine Type
    , select the type:
    • Ladder Diagram
    • Structured Text
  7. (optional) Select
    Open New Routine
    to open the routine for editing after you create the routine.
  8. Select
    Create
    . The routine appears in
    System
    under the selected program and is preceded by Ladder Icon or Structured Text Icon .
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal