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

Ladder logic program
                                                                             Ladder logic program
                      LES                             Output   L2           LEQ                   PL1      Output   L2
                      LESS THAN (A<B)       PL1                             LESS THAN OR EQUAL
                      Source A                      PL1                            (A B)                 PL1
                      C5:10.ACC                                             Source A
                      Source B                                              C5:1.ACC
                      350                                                   Source B
                                                                            457
               Figure 10-24  LES logic rung.
                                                                     Figure 10-26  LEQ logic rung.

               example of a GRT logic rung. The operation of the rung
               can be summarized as follows:                           •  The value stored at source B is 23.
                                                                       •  Therefore the output will be true or on.
                 •  The instruction is either true or false, depending on
                    the values being compared.                          The less than or equal (LEQ) instruction is an input
                 •  When the accumulated value of timer T4:10, stored   instruction  that  compares  source  A  to source  B:  when
                    at the address of source A, is greater than the con-  source A is less than or equal to source B, the instruction
                    stant 200 of source B, the output will be on; other-  is logically true; otherwise it is logically false. Figure 10-26
                    wise the output will be off.                     shows an example of an LEQ logic rung. The operation of
                                                                     the rung can be summarized as follows:
                  The less than (LES) instruction is an input instruction that
               compares source A to source B: when source A is less than   •  When the accumulated count of counter C5:1 is less
               source B, the instruction is logically true; otherwise it is logi-  than or equal to 457, the pilot light will turn on.
               cally false. Figure 10-24 shows an example of an LES logic   •  The accumulated value of the counter is less than 457.
               rung. The operation of the rung can be summarized as follows:  •  Therefore the output will be false or off.

                 •  The instruction is either true or false, depending on   Figure 10-27 shows an example of an up-counter used
                    the values being compared.                       in conjunction with the LES, EQU, and GRT compare
                 •  When the accumulated value of counter C5:10,     instructions to trigger outputs based on different values
                    stored at the address of source A, is less than the   of the counter’s accumulated count. The operation of the
                    constant 350 of source B, the output will be on;   program can be summarized as follows:
                    otherwise, it will be off.                         •  A Less Than (LES) 10 comparison is made with the
                  The  greater  than or  equal  (GEQ)  instruction is  an   counter’s accumulative value. As a result, the LESS
               input instruction that compares source  A to source  B:    Output will be energized anytime the accumulated
               when source A is greater than or equal to source B, the    count is 9 or less.
               instruction is logically true; otherwise it is logically false.   •  An Equal (EQU) to 20 comparison is made with the
               Figure 10-25 shows an example of a GEQ logic rung. The     counter’s accumulative value. As a result, the EQU
               operation of the rung can be summarized as follows:        Output will be energized only when the accumu-
                 •  When the value stored at the address of source A,     lated count is 20.
                    N7:55, is greater than or equal to the value stored at   •  A Greater Than (GRT) 30 comparison is made with
                    the address of source B, N7:12, the output will be    the counter’s accumulative value. As a result, the
                    true; otherwise, it will be false.                    GRT Output will be energized anytime the accumu-
                 •  The value stored at source A is 100.                  lated count is 31 or more.
                                                                        The limit test (LIM) instruction is used to test whether
                                                                     values are within or outside the specified range. Applica-
                       Ladder logic program            Output
                     GEQ                                       L2    tions in which the limit test instruction is used include
                     GREATER THAN OR EQUAL   PL1                     allowing a process to operate as long as the temperature is
                             (A B)                                   within or outside a specified range.
                     Source A        N7:55          PL1                 Programming the LIM instruction consists of entering
                                      100
                                                                     three parameters: low limit, test, and high limit. The limit
                     Source B        N7:12                           test instruction functions in the following two ways:
                                       23
                                                                       •  The instruction is true if—The lower limit is
               Figure 10-25  GEQ logic rung.                              equal to or less than the higher limit, and the test



               218        Chapter 10  Data Manipulation Instructions







          pet73842_ch10_207-233.indd   218                                                                              03/11/15   4:02 PM
   232   233   234   235   236   237   238   239   240   241   242