Page 65

Petruzella_ProgrammableLogicControllers__5e

Input Ladder logic program Figure 15-43  ONS instruction used to perform a calculation once per scan. The One-Shot Rising (OSR) instruction shown in Figure 15-44 is an output instruction which produces an output for one program scan when the input rises from zero to one (leading edge of the input pulse). The OSR instruction sets or clears the output bit, depending on the status of the Storage Bit (SB). When enabled and the storage bit is cleared, the OSR instruction sets the output bit. When enabled and the storage bit is set or when disabled, the OSR instruction clears the output bit. The One-Shot Falling (OSF) instruction shown in Figure 15-45 is an output instruction which produces an output for one program scan when the input drops from one to zero (falling edge of the input pulse). The OSF instruction sets or clears the output bit depending on the OSR One Shot Rising OB SB Storage Bit ? Rung-condition-in Storage Bit Output Bit Output Bit ? Instruction is executed Instruction resets during next scan execution 354 Part 2  Bit-Level Programming status of the storage bit. When disabled and the storage bit is set, the OSF instruction sets the output bit. When disabled and the storage bit is cleared, or when enabled, the OSF instruction clears the output bit. One-shot instructions are very useful for math operations. The program of Figure 15-46 shows an example of a program that makes use of all three one-shot instructions. The function of the program is to add 4, 8, or 12 to a register each time the associated input sensor detects a product. The instructions evaluate the preceding conditions, and when either the ONS, OSR, or OSF input changes state, a shot is triggered. The Clear Sums input pushbutton is used to clear all three instructions back to zero. L1 Limit_Switch_1 Limit_Switch_1 <Local:1:I.Data.6> Storage_1 ONS ADD Add Source A Source B Sum 0 1 Dest Sum 0 Figure 15-44  One-Shot Rising (OSR) instruction. OSF One Shot Falling OB SB Storage Bit ? Rung-condition-in Storage Bit Output Bit Output Bit ? Instruction is executed Instruction resets during next scan execution Figure 15-45  One-Shot Falling (OSF) instruction.


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above