Now You have a grasp on the basic principles of ladder logic, you are ready to start combining them into bigger structures that can do more interesting things. The first of which we are going to show you is a latch. Image 4.1 shows an example of this. There are two new concepts at work here – The fact that the B contact is different, and the fact that X is both a contact, AND a coil in the same rung of the ladder.
Image 4.1 An OR Structure(Above) And A Latch(Below)
The B contact in the latch is what is known as “normally closed” or “NOT B” – The contacts you have seen so far have all been normally closed contacts, these are closed when true, and open when false. This is because the default state for a contact when unpowered is open - hence, normally open : Power can only flow when they are energised, which will then close them.
However, normally closed contacts, allow power through as a default state. They block (Open) when the statement is true and the contact is energised. In order to set a contact to normally closed or normally open, use the drop down menu on the contact dialog – See image 1.14.
Image 4.2 Setting a contact to normally closed
Now, back to the latch, you can see that this reads as “X is set, if ((A OR X) AND (NOT B)).” This has the interesting property, that while B is false, if A becomes true, then goes false again, X will stay true (latch) until B becomes true. If B is already true, A will have no effect on the state of X. If you are familiar with electronics logic gates, this is principally similar to a set-reset flip-flop (With Q' missing).
This sort of construct is extremely useful for catching short pulses and storing the fact that they have happened until they can be dealt with, at which point they can be reset. There are all sorts of other uses as well, but that list is as extensive as the imagination of the wielder, so won’t be written here.
Hopefully you are beginning to see that a little logic can go a long way, dont stop reading yet though! There are still a lot more basics to cover before you are ready to rush off into the wide world of PLC programming. The next one coming being tutorial five, the One - Shot.