RsLogix 500 Training - Flip Flop - One Shots ONS OSR OSF
One shots can be very useful for capturing specific events such as an encoder home switch, the leading edge of a part on a conveyor for timing a specific event, and other time sensitive events.
To begin, create a new program and enter the following code so you can understand the purpose of one shots. When completed, download it to your PLC, go to run mode, and go online with the processor.
The purpose of these two rungs are to help you understand the need for the one shot. Pressing the green button once will turn on the green light. Pressing the green button again will turn off the green light.
The ONS instruction in Rung 0 is true for one scan when the instructions preceding it are true. Use what you learned about the scan cycle in the RsLogix 500 - Seal In Rung and PLC Scan Explanation lesson to better understand how Rung 1 works.
Rung 2 is to help you understand how the one shot can help you capture a specific event. It is identical to Rung 1 except instead of using the B3:0/1 that is triggered off of the one shot it uses I:0/0 that is connected to the green button. Press and hold the green button while looking at the B3:0/2 "This is what happens without the ONS" bit. Note that sometimes it is on, sometimes it is off, and it appears erratic. Is it actually erratic or is there a logical explanation for it looking erratic?
You can find the answer to at the end of this article.
There are two other types of one shots, the OSR One Shot Rising and OSF One Shot Falling. Add the following four rungs to your program.
OSR One Shot Rising - Rungs 3 and 4 use the OSR One Shot Rising bit. Pressing the Yellow Button once will turn on the Yellow Light. Pressing the Yellow Button again will turn off the Yellow Light. The OSR One Shot Rising has two bits.
Storage bit - is used to remember the state of the OSR. It is very similar to the EN enable bit of a timer and counter and means that instructions preceding the OSR are true. Typically this instruction isn't addressed in the program.
Output bit - The output bit is set for one scan when the instructions preceding the instruction are true. The timing of this one scan is important to understand. The bit will be set as true on Rung 3 and stay true until the program comes back around to Rung 3 again then turn off.
OSF One Shot Falling - Rungs 5 and 6 use the OSF One Shot Falling bit. Pressing the Blue Button does nothing, but releasing the Blue Button will turn on the Blue Light. Pressing and then releasing the Blue Button again will turn off the Blue Light. The OSF One Shot Falling has two bits.
Storage bit - is used to remember the state of the OSF. It is very similar to the EN enable bit of a timer and counter and means that instructions preceding the OSR are true. Typically this instruction isn't addressed in the program. Note that this is IDENTICAL to the OSR. Only the Output bit functions differently.
Output bit - The output bit is set for one scan when the instructions preceding the instruction are FALSE.
One shots can be very useful in capturing specific events and executing time specific code. Next, proceed to the RsLogix 500 - Using Forces and Understanding the Difference Between Input and Output Forces lesson.