Page 64

Petruzella_ProgrammableLogicControllers__5e

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


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above