If you understand basic electrical diagrams, it is much easier to understand ladder logic as it is used in a PLC. In fact, that was the whole idea behind ladder logic. It was supposed to look, and work, like real electrical circuits.
Excerpted from “The Beginner’s Guide to PLC Programming”
In its elementary form, PLC logic is very similar to the hard-wired logic you would find in an electrical ladder diagram. For example, if you wanted to turn on a light with a momentary pushbutton, you would wire it like the circuit below.
There are a number of addressing schemes used by PLC manufacturers. Let’s take a quick look at how memory locations (including hardware I/O) are accessed with RSLogix 500. Along the way, I will define some terms.
INSTRUCTION – RSLogix’s command language is comprised of “instructions”. An XIC (it looks like a normally open contact –] [– ) is an instruction. A timer is an instruction. A few of the most common instructions are described below.
BIT – an address within the PLC. It can be an input, output or internal coil, among others.
In RSLogix, there are a couple of ways to show the address of a bit. The default is:
For example, an address that references an output of a MicroLogix 1100 is O:0/0. That is:
O:0/5 means that it is a physical output.
O:0/5 means that it uses Slot 0 (in the case of the 1100, this output is onboard)
O:0/5 means that it is the fifth output on the PLC.
By the way, don’t get the capital “O” confused with a zero.
RUNG – A section of the PLC ladder program that terminates in an output function of some type. Just like in an electrical ladder diagram, a rung has some type of output that is turned on or turned off by the preceding entities in the rung. The first rung in a ladder program is always 0000.
HARDWIRED INPUT – a physical connection to the PLC from an input device (switch or sensor, etc.).
RSLogix 5000 allows the use of “serial” logic that does not conform to traditional, electrical ladder logic.
For example, both of the rungs shown below are valid in RSLogix 5000. The both operate the same way.
Clearly, the second version would not work if wired that way in an equivalent electrical circuit. It would not be allowed in RSLogix 500, either.
The main advantage, in my opinion, to writing the code as it is shown . . .
Let’s assume that the output of our scales has been calibrated for 0-10 VDC. Zero volts equals 0 pounds, and 10 volts equals 2000 pounds.
Now we know the signal type is DC voltage, the range is 0-10 and the engineering units are pounds.
Right-click on the 1756-IF8 card in the Controller Organizer and choose “Properties”. Click on the “Configuration” tab and you will see this.
You’ll see that Channel 0, which is our Scales channel, is selected.
An SCP (Scale with Parameters) is a really handy instruction in RSLogix 500. It scales any range of values to a range defined by the programmer.
One of the common uses of the SCP instruction is to take the value from an analog input and scale it to an engineering value.
In the example below, you can see how the output from a set of scales can be scaled to show the actual weight of the tank.
In RSLogix 500, double-click on 0000. This opens up the ASCII editor.
Type SCP in the box and press enter. SCP stands for “Scale with Parameters”. It allows you to take an analog input from a sensor and scale it to the output units you want. [Note: You could certainly insert the instruction using the toolbar. I just wanted to show how to use the ASCII editor to insert an instruction.]
Gathering accurate information is an important aspect of troubleshooting. However well meaning, some of the people you deal with will not provide accurate information.
This may seem like stating the obvious, but always try to… [Read more]
Making a given modification may be simple. Remembering what you have changed, and how to restore the PLC to its original state may not be so simple.
This is a trap that many programmers fall into. . . [Read more]
Successful troubleshooting isn’t always about knowing the detailed specifications of a device, or understanding the nuances of a particular PLC.
Sometimes, it is simply about being able to see the big picture . . . [Read more]
Excerpted from How To Troubleshoot With A PLC