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

SQO                                Figure 12-12 shows an example of a ControlLogix
                                 Sequencer Output    EN                  time-driven  sequencer  output  program. The  program is
                                 Array            ?  DN                  designed to execute a sequential process involving five
                                 Mask             ?                      steps which control several outputs. The outputs which
                                 Dest             ?
                                 Control          ?                      are on for each step are shown in the table. The operation
                                 Length           ?                      of the program can be summarized as follows:
                                 Position         ?
                                                                           •  The array parameter SQO_Data_Array contains the
                   Figure 12-11  ControlLogix Sequencer Output (SQO)         desired output states for each step.
                   instruction.                                            •  The output states for each step are entered at the
                                                                             starting location SQO_Data_Array[0].
                   the SLC 500 Sequencer Output instruction. The six pa-   •  In this application none of the outputs are energized
                   rameters entered into this instruction are:               in step 0. When the SQO instruction executes, it
                                                                             will be in step 0 on initial start-up.
                     •  Array—An array tag of the type DINT is the first
                       entry you need to make. This is a word-level tag    •  When the SQO instruction advances to step 5, it
                       that defines the starting word of the sequencer data   will return to step 1 and continue from there.
                       array. The desired output conditions for each step   •  The mask has a constant hexadecimal value of
                       are manually entered into the array in the tag editor.   0000_00FF which is the same as 0000 0000 0000
                       The ControlLogix processor puts the radix and the     0000 0000 0000 1111 1111 binary bits. Each bit
                       # sign in front of the value to indicate the radix of the   corresponds to one output in the SQO instruction.
                       displayed number. For example, 16# (hexadecimal)    •  In this example the two hexadecimal Fs represent
                       or 2# (binary).                                       8 binary 1s in memory. A value of 1 in the mask
                     •  Mask—The Mask works exactly like the mask in         allows the output state from the step to be sent to
                       the MVM instruction. It can be a word level tag or    the Dest.
                       a hexadecimal program constant. When the SQO        •  The DN (done) bit of the 5-second TON Step_
                       transfers 32-bits of data to an output word, there    Timer is used to trigger the SQO instruction.
                       might be outputs associated with the word that do   •  Every time the timer ACC value reaches 5 seconds,
                       not need to be controlled by the SQO. By masking      the timer DN bit changes state causing the SQO
                       these bits the SQO will not control them and they     instruction to increment the Position number of the
                       could be used for other purposes in the program.      Control tag and move to the next step.
                     •  DEST—This is the word level data type DINT tag     •  Note that the timer DN bit also resets the ACC
                       where the data from the instruction will be sent.     value of the timer to 0 and the timer starts timing
                     •  Control—The tag of data type Control contains the    to 5 seconds again.
                       control structure for the instruction. The Control tag
                       has several bits that can be used: enable (EN), done
                       (DN), error (ER), and so on. The control element   12.3  Sequencer Programs
                       also contains the Length of the sequencer (number of   A sequencer program can be event-driven or time-driven.
                       steps) and the current Position (step in the sequence).  An event-driven sequencer operates similarly to a me-
                     •  Length—The length (LEN) parameter stores the     chanical stepper switch that increments by one step for
                       value that defines the number of steps the sequencer   each pulse applied to it. A time-driven sequencer oper-
                       should make. It also defines the number of words   ates  similarly  to  a mechanical  drum switch  that incre-
                       required in the sequencer array. Position 0 is the   ments automatically after a preset time period.
                       start-up position. The first time the SQO instruc-  A sequencer chart, such as the one shown in
                       tion is enabled it moves from position 0 to position   Figure 12-13, is a table that lists the sequence of operation
                       1 when the instruction is toggled. The instruction   of the outputs controlled by the sequencer instruction.
                       resets to position 1 at the end of the last step. The   These tables use a  matrix-style  chart format. A matrix
                       array size must be at least one element larger than   is a two-dimensional, rectangular array of quantities. A
                       the size of the length.                           time-driven sequencer chart usually indicates outputs on
                     •  Position—The Position (POS) parameter stores the   its horizontal axis and the time duration on its vertical
                       current step of the sequencer. Steps are numbered   axis. An event-driven sequencer indicates outputs on its
                       starting at zero.                                 horizontal axis and the input, or event, on its vertical axis.



                                                                     Sequencer and Shift Register Instructions  Chapter 12  259







          pet73842_ch12_252-280.indd   259                                                                              03/11/15   7:19 PM
   273   274   275   276   277   278   279   280   281   282   283