Page 356 - Programmable Logic Controllers, Fifth Edition - Mobile version
P. 356

Main Task                          programming language. When a routine is created it is
                                                                         specified as ladder logic, sequential function chart, func-
                                         Main Program                    tion block diagram, or structured text (Figure 15-9). Any
                                         Program_A                       one routine must be completely in the same language.
                                         Program_B
                                                                         The number of routines per project is limited only by the
                                      Unscheduled Programs
                                                                         amount of controller memory. Libraries of standard rou-
                   Figure 15-8  Order of execution of programs.          tines can be created that can be reused on multiple ma-
                                                                         chines or applications. A routine can be assigned as one
                                                                         of the following types:
                   execute. There is no executable code within a program.
                   Routines within programs will execute in the order listed   •  A main routine is one configured to execute first
                   below their associated task in the controller organizer as   when the program runs. Each program will have one
                   shown in Figure 15-8. In this example, according to the   main routine typically followed by several or many
                   listed order, the Main Program is scheduled to execute    subroutines.
                   first, Program_A second, and Progam_B third. Programs   •  A subroutine is one that is called by another rou-
                   that are not assigned to a task are unscheduled. Unsched-  tine. Subroutines are used for large or complex pro-
                   uled programs are downloaded to the controller but do     gramming tasks or tasks that require more than one
                   not execute.  These programs remain unscheduled until     programming language.
                   needed. Depending on the RSLogix 5000 software ver-     •  A fault routine is one that executes if the controller
                   sion as many as 100 programs could be scheduled within    finds a program fault. Each program can have one
                   each task.                                                fault routine, if desired.

                   Routines                                              Tags

                   Routines are the third level of scheduling within a proj-  Unlike conventional controllers, ControlLogix uses a tag-
                   ect and provide the executable code for the project. Each   based addressing structure. Tags are meaningful names,
                   routine  contains  a  set  of  logic  elements  for  a  specific   descriptive of your application and not merely generic







































                                Figure 15-9  Each routine contains a set of logic elements for a specific programming language.
                                Source: Image Courtesy of Rockwell Automation, Inc.



                                                                               Memory and Project Organization  Part 1  337







          pet73842_ch15_333-394.indd   337                                                                              03/11/15   7:32 PM
   351   352   353   354   355   356   357   358   359   360   361