Sie sind auf Seite 1von 3

Chapter 5 - Mnemonic Programming Code

close commands instead of OR LD. Mitsubishi controllers use OR BLK instead of OR LD.
Some controllers will use STR in place of LD. Also, in some cases all coils may be entered
as OUT with an associated number that specifies it as an output or internal coil. The
concept is generally the same, but commands vary with controller manufacturer type and
even by model in some units.
Adding the coil command for the ladder diagram of Figure 5-4, the commands
required are as follows:
1.
2.
3.
4.
5.
6.

LD
AND
LD
AND
OR
STO

IN1
IN2
IN3
IN4
LD
OUT1

ENTER
ENTER
ENTER
ENTER
ENTER
ENTER

As a matter of comparison, if the above program had been input into a controller that
utilizes STR instead of LD and OUT instead of STO, the commands would be as below:
STR
AND
STR
AND
OR
OUT

IN1
IN2
IN3
IN4
STR
101

ENTER
ENTER
ENTER
ENTER
ENTER
ENTER

The 101 associated with the OUT statement designates the coil as number 101, which, in
the case of this particular PLC would, by PLC design, cause it to be an internal or output
coil as defined by the PLC manufacturer. As can be seen, the structure is the same but
with different commands as required by the PLC being used.
Let us now discuss the ladder rung of Figure 5-5. Recall that this is an OR-AND-OR
logic rung having a Boolean expression as shown in Equation 5-2.

OUT1 = (IN1+ IN2)(IN3 + IN4)


Two branches can be seen in this expression; (IN1 OR IN2) and (IN3 OR IN4).
These two branches are to be AND'ed together.

5-7

(5-2)

Chapter 5 - Mnemonic Programming Code

Figure 5-5 - Ladder Diagram to Implement OR - AND - OR


Function
Using the LD and STO commands and the same approach as in the examples above, the
command structure would be as follows:
1.
2.
3.
4.
5.
6.

LD
OR
LD
OR
AND
STO

IN1
IN2
IN3
IN4
LD
OUT1

ENTER
ENTER
ENTER
ENTER
ENTER
ENTER

As in the previous example, the LD command in line 3 causes lines 1 and 2 to be


transferred to the stack. Line 5 causes the active area and stack to be AND'ed with each
other.
5-7.

Complex Branches

Now that we have discussed basic AND and OR techniques and simple branches,
let us look at a rung with a more complex logic expression to illustrate how multiple
branches would be programmed. Consider the rung of Figure 5-6. As can be seen, there
are multiple logic expressions contained in the overall ladder rung. The Boolean
expression for this rung is shown in Equation 5-3.

5-8

Chapter 5 - Mnemonic Programming Code

Figure 5-6 - Complex Ladder Rung

OUT1 = ((((IN1+ IN3 + IN8)(IN2 + IN7))


+IN5)( IN 4 + IN 9)) + IN 6

(5-3)

To develop the program commands for this logic, we will begin with the innermost
logic expression. This is IN1' + IN3 + IN8'. The commands to enter this expression are:
1.
2.
3.

LD
OR
OR

NOT IN1
IN3
NOT IN8

ENTER
ENTER
ENTER

The next expression to enter is IN2 + IN7', which must be AND'ed with the expression now
in the active area. To accomplish this, the logic in the active area must be transferred to
the stack, the next expression entered, and then AND'ed with the stack. The command
lines for this are:

5-9

Das könnte Ihnen auch gefallen