Homework...?
Ok here is one example. First two rungs are classic latch/unlatch.
Next two rungs are equivalent (at least on 16-bit word level).
Feel free to use it. I hope you get good answer when your teacher
asks you to explain how it works...
The LATCH or SET instruction enables the assigned relay coil to stay on when the rung (that ends with the LATCH?SET) is compleated. The assigned coil will stay on when the circuit in the rung that feeds the coil goes off.
The UNLATCH or RST instruction turns off the assigned coil when the circuit that feeds the UNLATCH/RST is compleated..
For example.
start Motor on
---||----------------------(SET A)
n/o button
stop Motor off
---||---------------------(RST A)
m/o button
See what you think of this one!
In the MVM
N7:0 contains the value 0
N7:1 contains the mask value which is 0001 Hex
Obviously, when you press latch, the output latches itself on and will not turn off until the unlatch is pressed which uses the MVM. This method only manipulates the B3:1/0 bit and leaves the other bits in the word free to use any way you choose.
Just so there's no confusion, Omron's KEEP function is a 2 input device. Some might confused Bob's example as two separate rungs, so just to clarify...
I actually prefer the 'combined' KEEP instruction over separate SET and RESET instructions. In my Omron days, you didn't have a choice. There were no separate SET and RESET functions. Therefore, there was no temptation to put the SET and RESET a mile apart in the program!...
I think Siemens gives you a choice as well. Choice is good... :nodi:
beerchug
-Eric
P.S. to Bob... I see you're enjoying your new 'crotchety old man' smiley...
You might want to stick it in your signature so you don't have to paste it in each time.