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

Inputs                    Ladder logic program                              Outputs
                    L1                                                                                                   L2
                                         Motor_Stop      Motor_Start            Track_Motor
                                        <Local:1:I.Data.0>  <Local:1:I.Data.1>  <Local:2:O.Data.0>   Do_Not_Enter_Sign
                           Motor_Stop

                                                         Track_Motor      Enter_LS
                           Motor_Start
                                                      <Local:2:O.Data.0>  <Local:1:I.Data.2>  Wash_In_Use  Track_Motor
                                                                                          L
                            Stop

                                                                                    Do_Not_Enter_Sign
                            Start        Wash_In_Use                                <Local:2:O.Data.1>
                            Enter_LS

                                           Exit_LS
                                        <Local:1:I.Data.3>                            Wash_In_Use
                                                                                          U
                             Exit_LS




                   Figure 15-42  Latch/unlatch instruction used as part of a car wash program.

                     •  When the OTL goes false, the output address will   •  When the car exits the car wash, the Exit_LS con-
                       remain a 1.                                           tact momentarily closes and energizes the Wash_In_
                     •  This is true even if the processor powers down and   Use unlatch instruction.
                       then back up.                                       •  This in turn, de-energizes the Do_Not_Enter_Sign
                     •  The output address will remain a 1 until reset to 0   to indicate the car wash is not in use.
                       by the unlatch instruction.                         •  The track motor remains running ready to restart the
                     •  If the output address is off, both the latch and un-  process once another car enters.
                       latch instructions are not intensified, but once the bit   •  Once running, the track motor can be stopped at
                       is turned on, you will see both the latch and unlatch   any time by operating the Motor_Stop button to de-
                       intensified even though both inputs are shut off.     energize the Track_Motor.
                     Figure 15-42 shows an application of the latch/un-
                   latch instruction used as part of a car wash program. The   One-Shot Instruction
                   car wash uses a conveyor chain that pulls cars along a   The CLX One-Shot (ONS) instruction is an input instruc-
                   track. The operation of the program can be summarized   tion used to turn an output on for one program scan only.
                   as follows:                                           The program of Figure 15-43 uses the ONS instruction with
                     •  The car wash only washes one car at a time.      a math instruction to perform a calculation once per clos-
                                                                         ing of the switch. This program is used to execute the ADD
                     •  The operator controls the ON/OFF operation of    math function only once per actuation of the limit switch,
                       the track motor with the track motor Stop and Start   no matter how long the limit switch is held closed. The
                       pushbuttons.                                      operation of the program can be summarized as follows:
                     •  When the Motor_Start button is closed the Track_
                       Motor is energized and performs a seal-in function   •  On any scan for which limit_switch_1 is cleared or
                       that keeps the motor operating when the Motor_        storage_1 is set, this rung has no effect.
                       Start button is released.                           •  On any scan for which limit_switch_1 is set and stor-
                     •  As the car enters the car wash, the Enter_LS contact   age_1 is cleared, the ONS instruction sets storage_1
                       momentarily closes to energize the Wash_In_Use        and the ADD instruction increments sum by 1.
                       latch instruction.                                  •  As long as limit_switch_1 stays set, sum stays
                     •  This in turn, energizes the Do_Not_Enter_Sign to     the same value. The limit_switch_1 must go from
                       indicate that the car wash is in use.                 cleared to set again for sum to be incremented again.



                                                                                        Bit-Level Programming  Part 2   353







          pet73842_ch15_333-394.indd   353                                                                              03/11/15   7:33 PM
   367   368   369   370   371   372   373   374   375   376   377