الأحد، 5 يناير 2014

One-shots
A one-shot is an interesting and invaluable programming tool. At first glance it might be difficult to figure out why such an instruction is needed. After we understand what this instruction does and how to use it, however, the necessity will become clear.
A one-shot is used to make something happen for ONLY 1 SCAN. (you do remember what a scan is, right??) Most manufacturers have one-shots that react to an off to on transition and a different type that reacts to an on to off transition. Some names for the instructions could be difu/difd (differentiate up/down), sotu/sotd (single output up/down), osr (one-shot rising) and others. They all, however, end up with the same result regardless of the name.
One-shot instructionOne-shot Instruction
Above is the symbol for a difu (one-shot) instruction. A difd looks the same but inside the symbol it says "difd". Some of the manufacturers have it in the shape of a box but, regardless of the symbol, they all function the same way. For those manufacturers that don't include a differentiate down instruction, you can get the same effect by putting a NC (normally closed) instruction before it instead of a NO(normally open) instruction. (i.e. reverse the logic before the difu instruction)
Let's now setup an application to see how this instruction actually functions in a ladder. This instruction is most often used with some of the advanced instructions where we do some things that MUST happen only once. However, since we haven't gotten that far yet, let's set up a flip/flop circuit. In simple terms, a flip/flop turns something around each time an action happens. Here we'll use a single pushbutton switch. The first time the operator pushes it we want an output to turn on. It will remain "latched" on until the next time the operator pushes the button. When he does, the output turns off.
Here's the ladder diagram that does just that:Flip-flop ladder diagram
Now this looks confusing! Actually it's not if we take it one step at a time.
  • Rung 1-When NO (normally open) input 0000 becomes true DIFU 1000 becomes true.
  • Rung 2- NO 1000 is true, NO 1001 remains false, NC 1001 remains true, NC 1000 turns false. Since we have a true path, (NO 1000 & NC 1001) OUT 1001 becomes true.
  • Rung 3- NO 1001 is true therefore OUT 500 turns true.
Next Scan
  • Rung 1- NO 0000 remains true. DIFU 1000 now becomes false. This is because the DIFU instruction is only true for one scan. (i.e. the rising edge of the logic before it on the rung)
  • Rung 2- NO 1000 is false, NO 1001 remains true, NC 1001 is false, NC 1000 turns true. Since we STILL have a true path, (NO 1001 & NC 1000) OUT 1001 remains true.
  • Rung 3- NO 1001 is true therefore OUT 500 remains true.
After 100 scans, NO 0000 turns off (becomes false). The logic remains in the same state as "next scan" shown above. (difu doesn't react therefore the logic stays the same on rungs 2 and 3)
On scan 101 NO 0000 turns back on. (becomes true)
  • Rung 1-When NO (normally open) input 0000 becomes true DIFU 1000 becomes true.
  • Rung 2- NO 1000 is true, NO 1001 remains true, NC 1001 becomes false, NC 1000 also becomes false. Since we no longer have a true path, OUT 1001 becomes false.
  • Rung 3- NO 1001 is false therefore OUT 500 becomes false.

0 التعليقات:

إرسال تعليق