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

L1  L2        Discrete Inputs                    L1
                L2





                 AC  I/0  I/1  I/2  I/3  AC  I/4  I/5  I/6  I/7  I/8  I/9  I/10  I/11  I/12  I/13  I/14  I/15  I/16  I/17  I/18  I/19
                COM            COM
                           VAC  O/0  VAC  O/4  VAC  O/2  O/3  VAC  O/4  O/5  O/6  O/7  VAC  O/8  O/9  O/10 O/11
                           VDC   VDC   VDC     VDC            VDC


                              CR             CR   CR  CR  CR  CR  CR  CR  CR  CR

                                VAC 2 VDC 1   VDC 2         VDC 3       VDC 3
                L1                 VAC 2   VDC 1         VDC 2          COM
                                   COM      COM           COM
               L2
                                         Discrete Outputs
               Figure 5-7  Typical micro PLC with predefined addresses.
               Source: Image Courtesy of Rockwell Automation, Inc.

                 •  If the program calls for a specific output to be ON,   5.2  Program Scan
                    its corresponding bit in the table is set to 1.
                 •  If the program calls for the output to be OFF, its   When a PLC executes a program, it must know—in real
                                                                     time—when external devices controlling a process are
                    corresponding bit in the table is set to 0.      changing. During each operating cycle, the processor reads
                 •  The processor continually activates or deactivates the   all the inputs, takes these values, and energizes or de-
                    output status according to the output table file status.  energizes the outputs according to the user program. This
                  Typically, micro PLCs have a fixed number of inputs   process is known as a program scan cycle. Figure 5-8 illus-
               and outputs. Figure 5-7 shows the MicroLogix controller   trates a single PLC operating cycle consisting of the input
               from the Allen-Bradley MicroLogix 1000 family of con-  scan, program scan, output scan, and housekeeping duties.
               trollers. The controller has 20 discrete inputs with pre-  Because the inputs can change at any time, it constantly
               defined addresses I/0 through I/19 and 12 discrete outputs   repeats this cycle as long as the PLC is in the RUN mode.
               with predefined addresses O/0 through O/11. Some units   The time it takes to complete a scan cycle is called the
               also contain analog inputs and outputs embedded into the   scan cycle time and indicates how fast the controller can
               base unit or available through add-on modules.        react to changes in inputs. The time required to make a


                                                                                          The status of
                                                                                          external inputs
                                    Internal checks              START            INPUT   is written to the
                                 on memory, speed,                                SCAN    input image table
                                     and operation.                                       (file or register).
                                       Service any  HOUSE-
                                    communication  KEEPING
                                        requests.
                                                                                 Each ladder rung
                                                                      PROGRAM    is scanned and solved
                                                                        SCAN     using the date in the
                                                       OUTPUT
                                                        SCAN                     input file. The resulting
                                                                                 logic is written to the
                                          The output image                       output image table
                                         date is transferred                     (file or register).
                                       to the external output
                                         circuits, turning the
                                            output device
                                              ON or OFF.
                                 Figure 5-8  PLC program scan cycle.



               78         Chapter 5  Basics of PLC Programming







          pet73842_ch05_074-097.indd   78                                                                               05/11/15   4:17 PM
   92   93   94   95   96   97   98   99   100   101   102