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