Try our online PLC Simulator- FREE. Click here now to try it. |
Learn quickly with our PLC Training DVD Series: on sale
Click here now for details! Boolean Math Let's now take a look at some simple "boolean math". Boolean math lets us do some vary basic functions with the bits in our registers. These basic functions typically include AND, OR and XOR functions. Each is described below.
See the truth table below to figure out what we mean. (1 AND 1 = 1, 0 AND 0= 0)
The ladder logic instructions are commonly called AND, ANDA, ANDW, OR, ORA, ORW, XOR, EORA XORW. As we saw with the MOV instruction there are generally two common methods used by the majority of plc makers. The first method includes a single instruction that asks us for a few key pieces of information. This method typically requires:
AND symbol The instructions above typically have a symbol that looks like that shown here. Of course, the word AND would be replaced by OR or XOR. In this symbol, The source A is DM100, the source B is DM101 and the destination is DM102. Therefore, we have simply created the equation DM100 AND DM101 = DM102. The result is automatically stored into DM102. The boolean functions on a ladder diagram are shown below.
Please note that once again we are using a one-shot instruction. As we've seen before, this is because if we didn't use it, we would execute the instruction on every scan. Odds are good that we'd only want to execute the function one time when input 0000 becomes true. AND symbol (dual instruction method) The dual instruction method would use a symbol similar to that shown above. In this method, we give this symbol only the Source B location. The Source A location is given by the LDA instruction. The Destination would be included in the STA instruction. Below is a ladder diagram showing what is meant: The results are the same as the single instruction method shown above. It should be noted that although the symbol and ladder diagram above show the AND instruction, OR or EXOR can be used as well. Simply substitute the word "AND" within the instruction to be either "OR" or "EXOR". The results will be the same as shown in their respective truth tables. We should always remember that the theory is most important. If we can understand the theory of why things happen as they do, we can use anybody's plc. If we refer to the manufacturers documentation we can find out the details for the particular plc we are using. Try to find the theory in that documentation and you might come up short. The details are insignificant while the theory is very significant. Learn quickly with our PLC Training DVD Series: on sale Click here now for details! |
|||||||||||||||||||||||||||||||||||||||||||||||
copyright © 1996-2011 by Phil Melore.
All rights reserved. |