Page 48

Petruzella_ProgrammableLogicControllers__5e

Main Task Main Program Program_A Program_B Unscheduled Programs Figure 15-8  Order of execution of programs. execute. There is no executable code within a program. Routines within programs will execute in the order listed below their associated task in the controller organizer as shown in Figure 15-8. In this example, according to the listed order, the Main Program is scheduled to execute first, Program_A second, and Progam_B third. Programs that are not assigned to a task are unscheduled. Unscheduled programs are downloaded to the controller but do not execute. These programs remain unscheduled until needed. Depending on the RSLogix 5000 software version as many as 100 programs could be scheduled within each task. Routines Routines are the third level of scheduling within a project and provide the executable code for the project. Each routine contains a set of logic elements for a specific programming language. When a routine is created it is specified as ladder logic, sequential function chart, function block diagram, or structured text (Figure 15-9). Any one routine must be completely in the same language. The number of routines per project is limited only by the amount of controller memory. Libraries of standard routines can be created that can be reused on multiple machines or applications. A routine can be assigned as one of the following types: • A main routine is one configured to execute first when the program runs. Each program will have one main routine typically followed by several or many subroutines. • A subroutine is one that is called by another routine. Subroutines are used for large or complex programming tasks or tasks that require more than one programming language. • A fault routine is one that executes if the controller finds a program fault. Each program can have one fault routine, if desired. Tags Unlike conventional controllers, ControlLogix uses a tagbased addressing structure. Tags are meaningful names, 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


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above