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

•  Data are copied from file #B3:0 at the bit
                                                                          locations through mask word, F0FF hex or
                                                                          1111000011111111 binary, to the destination
                                                                          O:2. Mask bits are set to 1 to pass data and reset
                                                                          to 0 to mask data.
                                                                       •  Once the position reaches the last position on the
                                                                          true-to-false transition of the instruction the position
                                                                          will reset to 1.
               Figure 12-16  Sequencer file #N7:10 timer settings.     •  Note that the data in O:2 match the data in
               Source: Courtesy of TheLearningPit
                                                                          position 2 in the file, except for the data in bits
                                                                          8 through 11.
                  With an event-driven sequencer, the SQO instruction
               advances to the next step by an external pulsed input event   •  Bits 8 through 11 may be controlled from else-
               rather than a preset time. An example of an event-driven   where in the program; they are not affected by the
               sequencer is shown in Figure 12-18. The operation of the   sequencer instruction because of the 0 in these bit
               program can be summarized as follows:                      positions in the mask.
                                                                        The sequencer compare (SQC) instruction is an out-
                 •  The sequencer SQO instruction uses two OR con-   put instruction used to compare bits from an input source
                    figured sensor switches (S1 and S2).             file to corresponding bits from data words in a sequencer
                 •  Any one of the two parallel paths can make the   file. When the pairs of bits are the same, then the found
                    SQO rung true.                                   (FD) bit in the control register is set to 1. This instruction
                 •  As each event occurs, that OR branch makes a     can be used to compare the status of a machine’s input
                    false-to-true transition advancing the sequencer   devices with what is required for normal operation. When
                    position.                                        the status of the input devices on the machine (on or off)


                                    Input                      Ladder logic program
                                                                                             O:2      L2
                                                SW     T4:0/DN  TON
                               L1                              TIMER ON DELAY         EN     0
                                                               Timer             T4:1        1
                                        SW                     Time base          1.0  DN    2
                                                               Preset              3         3
                                                               Accumulated         0         4
                                                                                             5
                                                                 SQO                         6
                                                   T4:0/DN
                                                                 SEQUENCER OUTPUT            7
                                                                 File         #B3:0   EN     8
                                                                 Mask        0FFFFh          9
                                                                 Dest          O:2.0  DN    10
                                                                 Control       R6:0          11
                                                                 Length           8
                                                                 Position         0         12
                                                                                             13
                                                                                             14
                                                                                            15














                               Figure 12-17  Time-driven sequencer with constant time interval between steps.
                               Source: Courtesy of TheLearningPit



               262        Chapter 12  Sequencer and Shift Register Instructions







          pet73842_ch12_252-280.indd   262                                                                              03/11/15   7:20 PM
   276   277   278   279   280   281   282   283   284   285   286