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

Ladder logic
                                             Count_PB
                                           <Local:1:I.Data.1>
                                                                   CTU
                                                                   Count Up         CU
                                                                   Counter   C1
                                                                   Preset    25     DN
                                                                   Accum     0
                                                                                    PL_1
                                            GRT              LES               <Local:2:O.Data.1>
                                            Greater than (A>B)  Less than (A<B)
                                            Source A C1.ACC  Source A  C1.ACC
                                                        0                 0
                                            Source B    5    Source B    10
                                                                                   PL_2
                       L1    Inputs         EQU                                <Local:2:O.Data.2>  Outputs  L2
                                            Equal
                                            Source A C1.ACC
                                                        0                                       PL_1
                                Count_PB    Source B   15
                                                                                    PL_3
                                            NEQ                                <Local:2:O.Data.3>
                                            Not Equal                                          PL_2
                                            Source A C1.ACC
                                Reset_PB                0
                                            Source B   20
                                                                                               PL_3
                                              C1_DN                                  C1
                                                                                    RES
                                              Reset_PB
                                            <Local:1:I.Data.2>

                                                              FBD equivalent

                                                  CTUD_01
                      Sheet 1 of 4                 CTUD  ...           Sheet 2 of 4       GRT_02
                                                                                           GRT  ...
                                                Count Up/Down
                                          0                0                           Greater Than (A>B)
                                  Count_PB      CUEnable  ACC   ACC
                                                           0            ACC  0         Source A
                                                CDEnable  DN  2-B2 3-B2
                                            25                          1-C2       5               0     BAND_01
                                        25      PRE          4-B2               5      Source B  Dest
                                                Reset                                                    BAND  ...
                                                                                                        Boolean And
                                   BOR_01                                                LES_02        In1        0
                                   BOR  ...                                              LES  ...      In2    Out    PL_1
                                  Boolean Or                                           Less Than (A<B)
                              0
                      Reset_PB   In1       0                                           Source A   0
                                        Out                                        10        Dest
                                 In2                                            10     Source B

                                          EQU_01                                      NEQ_01
                      Sheet 3 of 4                                     Sheet 4 of 4
                                          EQU  ...                                    NEQ  ...
                                           Equal                                      Not Equal
                                    0              0                           0              0
                               ACC      SourceA  Dest  PL_2               ACC       SourceA  Dest  PL_3
                              1-C2      SourceB                          1-C2       SourceB
                                   15                                         20
                               15                                         20
                    Figure 15-112  Comparison between ladder logic and the FBD equivalent for a program used to test the accumulated
                    value of a counter.











                                                                                   Function Block Programming  Part 6   393







          pet73842_ch15_333-394.indd   393                                                                              03/11/15   7:34 PM
   407   408   409   410   411   412   413   414   415   416   417