Файл: Programmable logic controllers. Methods and Applications (Hackworth J., Prentice Hall).pdf
ВУЗ: Не указан
Категория: Не указан
Дисциплина: Не указана
Добавлен: 15.06.2025
Просмотров: 2141
Скачиваний: 0
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. |
LD |
IN1 |
ENTER |
2. |
AND |
IN2 |
ENTER |
3. |
LD |
IN3 |
ENTER |
4. |
AND |
IN4 |
ENTER |
5. |
OR |
LD |
ENTER |
6.STO OUT1 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 IN1 ENTER
AND IN2 ENTER
STR IN3 ENTER
AND IN4 ENTER
OR STR ENTER
OUT 101 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) |
(5-2) |
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
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. |
LD |
IN1 |
ENTER |
2. |
OR |
IN2 |
ENTER |
3. |
LD |
IN3 |
ENTER |
4. |
OR |
IN4 |
ENTER |
5. |
AND |
LD |
ENTER |
6.STO OUT1 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))
(5-3)
+IN5)(IN 4 + IN 9)) + IN 6
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. |
LD |
NOT IN1 |
ENTER |
2. |
OR |
IN3 |
ENTER |
3. |
OR |
NOT IN8 |
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
Chapter 5 - Mnemonic Programming Code
4. |
LD |
IN2 |
ENTER |
5. |
OR |
NOT IN7 |
ENTER |
6. |
AND |
LD |
ENTER |
Line 4 places the previous expression in the stack and begins the new expression and line
5 completes the new expression. Line 6 causes the stack logic to be retrieved and AND'ed with the active area with the result left in the active area. Referring to Equation 5-3 notice that the expression now located in the active area must now be OR'ed with IN5. This is a simple OR command since the first part of the OR is already in the active area. The command to accomplish this is:
7. OR IN5 |
ENTER |
Now the active area contains:
{(IN1' + IN3 + IN8') (IN2 + IN7')} + IN5
This must be AND'ed with (IN4 + IN9'). To input this expression we must transfer the logic in the active area to the stack, input the new expression, retrieve the stack and AND it with the expression in the active area. These commands are:
8. |
LD |
IN4 |
ENTER |
9. |
OR |
NOT IN9 |
ENTER |
10. |
AND |
LD |
ENTER |
Line 8 transfers the previous expression to the stack and begins input of the new expression, line 9 completes entry of the new expression and line 10 AND's the stack with the new expression. The active area now contains:
(((IN1' + IN3 + IN8') (IN2 + IN7')) + IN5) (IN4 + IN9')
As may be seen in Figure 6-1 - all that remains is to OR this expression with IN6 and add the coil command. The command lines for this are:
11. |
OR |
IN6 |
ENTER |
12. |
STO |
OUT1 |
ENTER |
Combining all the command lines into one set is shown below:
5-10
Chapter 5 - Mnemonic Programming Code
1. |
LD |
NOT IN1 |
ENTER |
2. |
OR |
IN3 |
ENTER |
3. |
OR |
NOT IN8 |
ENTER |
4. |
LD |
IN2 |
ENTER |
5. |
OR |
NOT IN7 |
ENTER |
6. |
AND |
LD |
ENTER |
7. |
OR |
IN5 |
ENTER |
8. |
LD |
IN4 |
ENTER |
9. |
OR |
NOT IN9 |
ENTER |
10. |
AND |
LD |
ENTER |
11. |
OR |
IN6 |
ENTER |
12. |
STO |
OUT1 |
ENTER |
The previous example should be reviewed to be sure operation involving the stack is thoroughly understood.
5-11
Chapter 5 - Mnemonic Programming Code
Chapter 5 Review Question and Problems
1.Draw the ladder diagram and write the mnemonic code for a program that will accept inputs from switches IN1, IN2, IN3, IN4 and IN5 and energize coil OUT123 when one and only one of the inputs is ON.
2.Draw the ladder diagram and write the mnemonic code for an oscillator named CR3.
3.Write the mnemonic code for the J-K Flip Flop.
4.Draw the ladder diagram, assign contact and coil numbers and write the mnemonic code for a T Flip Flop.
5.Write the mnemonic code for the ladder diagram of Figure 5-7.
Figure 5-7 - Ladder for Problem 5
5-12
Chapter 6 - Wiring Techniques
Chapter 6 - Wiring Techniques
6-1. Objectives
Upon completion of this chapter, you will know
”how to provide ac power to a PLC.
”various types of PLC input configurations.
”how to select the best PLC input configuration for an application.
”how to connect external components to PLC inputs.
”various types of PLC output configurations.
”how to select the best PLC output configuration for an application.
”how to connect PLC outputs to external components.
6-2. Introduction
A very important subject often overlooked in the study of programmable controllers is how to connect the PLC to the system being controlled. This involves connections of such devices as limit switches, proximity detectors, photoelectric detectors, external high current contactors and motor starters, lights and a vast array of other devices which can be utilized with the PLC to control or monitor systems. Wiring a device to the PLC involves the provision of proper power to the devices, sizing of wiring to insure current carrying capacity, routing of wiring for safety and to minimize interference, insuring that all connections are made properly and to the correct terminals, and providing adequate fusing to protect the system.
PLC systems typically involve the handling of circuitry operating at several different voltage and current levels. Power to the PLC and other devices may require the connection of 120 VAC while photoelectric and proximity devices may require 24 VDC. Motors being controlled by the PLC may operate at much higher voltage levels such as 240 or 480 VAC 3N. Current for photoelectric and proximity devices are in the range of milliamps while motor currents run much higher depending upon the size of the motor - 30 amps or more.
The PLC connections except for main power are confined to connecting inputs to sensing devices and switches and connecting outputs to devices being controlled (lamps, motor starters, contactors). This is the area this chapter will concentrate on since this is the main area of concern for the programmer. We will also touch on the other areas as required while discussing input and output connections.
6-1
Chapter 6 - Wiring Techniques
6-3. PLC Power Connection
The power requirement for the PLC being used will vary depending upon the model selected. PLC's are available that operate on a wide range of power typically 24 VDC, 120 VAC and 240 VAC. Some manufacturers produce units that will operate on any voltage from 120 VAC to 240 VAC without any modifications to the unit. Connection of power to the DC type units requires that careful attention be paid to insuring that the (+) and (-) power wires are correctly connected. Failure to do so can result in serious damage to the
PLC. Power connection to AC units is not so critical unless the PLC specifications may require specific connection of the hot and neutral wires to the proper terminals. However, no matter which style PLC is being utilized, proper fuses must be inserted in the power line connections to protect both the PLC and the power wiring from overcurrent either from accidental shorts or equipment failure causes. The installation manual for the particular
PLC being used will generally provide fusing information for that unit. The wiring diagram for an AC type PLC is shown in Figure 6-1.
Figure 6-1 - Typical AC Power Wiring
Notice that incoming power is first connected to a disconnect switch. This switch, when turned off, will disconnect all power from the fuses and the PLC. This provides safety for personnel performing maintenance on the system by totally removing power from the
6-2