Page 94 - Programmable Logic Controllers, Fifth Edition
P. 94

5.1  Processor Memory Organization
                                                                           •  System functions (file 0)—This file is always included
                                                                             and contains various system-related information and
                   While the fundamental concepts of PLC programming are     user-programmed information such as processor type,
                   common to all manufacturers, differences in memory orga-  I/O configuration, processor file name, and password.
                   nization, I/O addressing, and instruction set mean that PLC
                   programs are never perfectly interchangeable among different   •  Reserved (file 1)—This file is reserved by the pro-
                   makers. Even within the same product line of a single manu-  cessor and is not accessible to the user.
                   facturer, different models may not be directly compatible.  •  Main ladder program (file 2)—This file is always
                     The memory map or structure for a PLC processor con-    included and contains user-programmed instructions
                   sists of several areas, some of these having specific roles.   that define how the controller is to operate.
                   Allen-Bradley PLCs have two different memory structures   •  Subroutine ladder program (files 3–255)—These
                   identified by the terms rack-based systems and tag-based   files are user-created and are activated according to
                   systems. The SLC 500 family of controllers uses a rack-   subroutine instructions residing in the main ladder
                   based fixed memory structure. The I/O addresses are de-   program file.
                   rived using the slot location of the input and output modules
                   within the PLC rack. In comparison, the ControlLogix 5000   Data Files
                   series of controllers uses a tag-based memory structure for   The data file portion (Figure 5-3) of the processor’s memory
                   assigning and referencing memory locations. A tag is a   stores input and output status, processor status, the status
                   friendly name for a memory location. In tag-based memory   of various bits, and numerical data. All this information is
                   structures there are no fixed areas of memory allocated for   accessed via the ladder logic program. These files are or-
                   I/O addresses or other types of data. The memory organiza-  ganized by the type of data they contain and may include:
                   tion for rack-based systems will be covered in detail in this   •  Output (file 0)—This file stores the state of the out-
                   chapter and that for tag-based systems in Chapter 15.     put terminals for the controller.
                     Memory organization takes into account the way a      •  Input (file 1)—This file stores the status of the
                   PLC divides the available memory into different sections.   input terminals for the controller.
                   The memory space can be divided into two broad catego-
                   ries: program files and data files. Individual sections, their   •  Status (file 2)—This file stores controller operation
                   order, and the sections’ length will vary and may be fixed   information and is useful for troubleshooting con-
                   or variable, depending on the manufacturer and model.     troller and program operation.
                     Program files are the part of the processor memory    •  Bit (file 3)—This file is used for internal relay logic
                   that stores the user ladder logic program. The program    storage.
                   accounts for most of the total memory of a given PLC    •  Timer (file 4)—This file stores the timer accumu-
                   system. It contains the ladder logic that controls the ma-  lated and preset values and status bits.
                   chine operation. This logic consists of instructions that   •  Counter (file 5)—This file stores the counter accu-
                   are programmed in a ladder logic format. Most instruc-    mulated and preset values and status bits.
                   tions require one word of memory.                       •  Control (file 6)—This file stores the length, pointer
                     The data files store the information needed to carry out   position, and status bit for specific instructions such
                   the user program. This includes information such as the   as shift registers and sequencers.
                   status of input and output devices, timer and counter val-  •  Integer (file 7)—This file is used to store whole
                   ues, data storage, and so on. Contents of the data table can   number values or bit information.
                   be divided into two categories: status data and numbers or   •  Float (file 8)—The floating point file is used to
                   codes. Status is ON/OFF type of information represented   store fractional numerical data or numerical values
                   by 1s and 0s, stored in unique bit locations. Number or   greater than 32,767. This file applies to selected
                   code information is represented by groups of bits that are   PLC processors.
                   stored in unique byte or word locations.
                     Figure 5-1 shows the program and data file organiza-  The I/O address format for the SLC family of PLCs is
                   tion for the SLC 500 controller. The contents of each file   shown in Figure 5-4. The format consists of the following
                   are as follows.                                       three parts:
                                                                           Part 1: I for input, and a colon to separate the module
                   Program Files                                           type from the slot.
                   Program files (Figure 5-2) are the areas of processor memory   O for output and a colon to separate the module type
                   where ladder logic programming is stored. They may include:  from the slot.



                                                                                 Basics of PLC Programming  Chapter 5    75







          pet73842_ch05_074-097.indd   75                                                                               05/11/15   4:17 PM
   89   90   91   92   93   94   95   96   97   98   99