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

•  The retentive OSR instruction is true for only
                       one scan and then false again, even if the trig-       L1         Input  LS1  OSR rung   C5:1
                                                                                                      B3:0/0
                       gering proximity switch signal stays true. This                                 OSR      RES
                       may be required for the count pulse to operate                  LS1
                       properly.
                     •  After a count of 50, the done bit of the counter                      LS1
                       changes state to stop the conveyor motor automati-
                       cally and reset the counter’s accumulated value to                    B3:0/0
                       zero.                                                                    One PLC scan
                     •  The conveyor motor can be stopped and started    Figure 8-19  One-shot rising (OSR) instruction.
                       manually at any time without loss of the accumu-
                       lated count.
                     •  The accumulated count of the counter can be reset    instruction conditions the rung so that the counter
                       manually at any time by means of the count reset      C5:1 reset output instruction goes true for one pro-
                       button.                                               gram scan.
                     The Allen-Bradley SLC 500  one-shot rising (OSR)      •  The output reset instruction goes false and remains
                   instruction is an input instruction that triggers an event   false for successive scans until the input makes
                   to occur one time. The OSR instruction is placed in the   another false-to-true transition.
                   ladder logic before the output instruction.  When the   •  The OSR bit is set to 1 as long as the limit switch
                   rung conditions preceding the OSR instructions go from    remains closed.
                   false-to-true, the OSR instruction goes true also but for   •  The OSR bit is reset to 0 when the limit switch is
                   only one scan. Figure 8-19 illustrates the operation of an   opened.
                   OSR rung which can be summarized as follows:
                                                                           Applications for the OSR instruction include freez-
                     •  The OSR, one-shot rising instruction is used to   ing rapidly displayed LED values. Figure 8-20 shows a
                       make the counter reset instruction (RES) true for   one-shot instruction used to send data to an output LED
                       one scan when limit switch input LS1 goes from    display.  The one-shot allows the rapidly changing ac-
                       false to true.                                    cumulated time from the timer to be frozen to ensure a
                     •  The OSR is assigned a Boolean bit (B3:0/0) that is   readable, stable display. The operation of the program is
                       not used anywhere else in the program.            summarized as follows:
                     •  The OSR instruction must immediately precede the   •  The accumulated value of timer T4:1 is converted
                       output instruction.                                   to Binary Coded Decimal (BCD) and moved
                     •  When the limit switch closes the LS1 and OSR,        to output word O:6 where an LED display is
                       input instructions go from false to true. The OSR     connected.




                                        Inputs                                               Output
                                   L1  PB
                                                   I:1/0   B3:0/0                              0
                                                                   TOD                         1
                                            I:1/0          OSR     To BCD                      2
                                                                   Source       T4:1.ACC       3
                                       SW                          Destination      O:6        4
                                             I:1/1                                             5
                                                   I:1/1                                 O:6   6    0000
                                                             TON                               7
                                                             TIMER ON DELAY         EN         8
                                                             Timer            T4:1  DN         9
                                                             Time base         1.0            10
                                                             Preset          1000             11
                                                             Accumulated       0              12
                                                                                              13
                                                                                              14
                                                                                              15
                                   Figure 8-20  OSR instruction used to freeze rapidly displayed LED values.



                                                                                     Programming Counters  Chapter 8    165







          pet73842_ch08_156-183.indd   165                                                                              03/11/15   3:58 PM
   179   180   181   182   183   184   185   186   187   188   189