Ladder Logic in Plain English


Introduction to Ladder Logic in Plain English

Sometimes, its easier to think of Ladder Logic in Plain English. With a little practice, you can easily speak ladder logic. In this case, we’ll use simple generic addressing. It’s important to realize, though that you should have descriptions on your logic. This method works well when you describe everything in the high, or true state.

Learning to convert ladder logic to plain English also helps with structured text. The most common statement in structured text is the if… then… statement.

Basic Instructions

Before we begin, there are some basic instructions we need to understand.

Examine ON

First, we’ll talk about the XIC (Examine If Closed), or “Examine On” instruction. In logic, this appears as a normally open relay contact. It’s important to realize, however, this does not represent a real contact. This is simply an instruction. The XIC can look at any bit anywhere in memory. If the bit is a 1, the XIC is true. On the other hand, if the bit is 0, the XIC is false.

Always remember, this instruction looks for a 1. Other ways to express this would be that A must be HIGH, or A must be TRUE.

Examine OFF

Next, we’ll discuss the XIO (Examine if Open) Instruction. Also known as the “Examine OFF” instruction, this bit looks for a zero to be true. In other words, the bit must be 0, LOW, or FALSE.

Think of this as a NOT instruction. The bit can look at any bit anywhere in memory. If the bit is NOT on, then the instruction is true.

Output To Energize

The OTE (Output To Energize) writes a value to a bit. Because it can change the value of a bit, we consider this instruction to be destructive. You should not use this instruction to write to the same bit twice in a project. It’s good programming practice to only have one instruction writing to a bit. There are a few exceptions to this rule, such as the latch/unlatch instructions.

Keep in mind that when the rung is true (logical power to the instruction), the OTE writes the value of 1. On the other hand, if the rung is false, the OTE writes a 0.

Simple If… Then… Statements

Let’s consider the following rung :

We would simply say, “If A THEN B”. This doesn’t mean a lot to us, but let’s look at this rung when we add descritipons.

To express this in plain English using descritipoons, we would say, “IF Pump 1 is Selected, THEN Run Pump 1”.

Let’s look at another example using the XIO:

In the above example, we would say, “If Pump 2 is NOT selected, THEN run Pump 1”.

AND Logic

Whenever we have instructions in series, the logic is AND’ed together. In other words, the statements before and after the AND statement must both be true. Consider the following example:

We would express this as, “If Pump 1 is Selected AND Pump 2 is NOT Selected, then Run Pump 1. In this case, we have a type of interlock. If we select both pumps at the same time, Pump 1 will not run.

OR Logic

Lastly, we’ll discuss OR logic. Consider the following rung:

If Pump 1 is Selected, OR Emergency Run is true, then Run Pump 1.

Complex Logic

Let’s try some complex logic. In this case, we’ll have a combination of AND, OR, and NOT logic. Always pay attention to the parenthesis. This will help you understand how the logic works.

Let’s see if this rung makes sense. If (we are in local mode AND we press the valve button) OR (we are not in local mode, and get an open signal from SCADA), THEN open the valve.

To put it another way, if we are in local mode, we must hit the local valve button. Or if we are not in local mode (meaning we are in remote mode), and we get a signal from SCADA, then open the valve.

Summary

In short, by understanding basic logic statements, we can express our ladder logic in plain English. With NOT statements, the but must be OFF. With AND statements, everything in series must be true. OR statements are in parallel. This means that any one of the OR’ed conditions can be true.

Visit the ControlLogix Category Page for more information on ControlLogix!

— Ricky Bryce

Leave a comment

Your email address will not be published. Required fields are marked *