Controllers
2.0.0 Introduction to Data and Program Control
The modern PLC has a wide variety of instructions for a variety of control options. In this module we will explore and make application of the group of instructions that perform operations on bit sized data. The PLC can receive information from a variety of digital inputs such as switches and sensors. From this input information the PLC can perform control operations on discrete on-off outputs.
2.1.1 Exploration: The Relay Type Instructions
In the previous chapters several ladder logic programs were written involving the XIC command. Set up your PLC to turn on a light when a N.O. push button is pressed. The symbol for the normal output is shown in figure 2.1a and is called an OTE or Output Energize. Use a Project Planning Sheet and draw the ladder diagram and the wiring diagram. Have the instructor review your sheet then program the PLC and run the program. Note carefully on your ladder the address of the input switch and the output light.
OTEOutput Enable / ---( ) ---
OTL
Output Latch / ---(L)---
OTU
Output Unlatch / ---(U)---
Figure 2.1a
On your PPS draw a table showing the light condition for each switch condition. Label the output column as OTE.
Modify your program to replace the OTE type output with the OTL. This symbol is shown in figure 2.1a. Run this version of the program and add the output conditions to your table of light conditions under an OTL column.
Cycle the power to your PLC (turn it off and back on). Record the output conditions after the power cycling process.
Questions:
- When the input switch is on, using an OTL instruction, what is the output state?
- What effect did turning off the power have on the output condition with the OTL instruction?
- Can you think of some times this may not be a desirable behavior for the PLC?
2.1.2 Dialog: The Basic Latch
In the above activity the OTL instruction was explored. The OTL allows the output to be “latched” or held on, even after the input returns to the off state. In fact, once set to on, the output will remain on unless changed by the program or some troubleshooting event. Even turning off the power will not unlatch the output. When power is restored, the output will re-energize. This could result in a safety hazard. For example, if the plant experiences a power outage, when power is restored the device controlled by the OTL output would start up. In situations where this is a safety hazard the OTL is not the best choice for output control, additional external circuits may be required to unlatch or hold power off until the system can be reset.
2.1.3 Exploration: Turning Off the Latch
To turn off the OTL latching action requires a new instruction , the OTU or output unlatch. (See figure 2.1a for the menu symbol.) Add a new rung to your OTL experiment containing an XIC and the OTU output. The XIC should relate to a separate N.O. switch from the one used to set the Latch. However, the output number for the OTU must match exactly with the number used for the OTL output.
Add this new rung to your program and draw it also on your Project Planning Sheet. Run the program. You should find that you can latch and unlatch the output with the two switches.
Fill out the chart below as an aid in describing this circuit behavior.
SW1 represents the switch that latches the output and SW2 represents the switch that unlatches the output. Experiment with several combinations as the behavior may change based on the prior sequence of events. Zero represents the switch is off and the one represents the switch is on or pressed.
SW1 / SW2 / Output Condition / Description of behavior0 / 0
0 / 1
1 / 0
1 / 1
Questions:
- Describe the predictability of each condition of the circuit.
- How could this circuit be used for a start-stop circuit on a motor?
2.1.4 Dialog: The SET-RESET Latch and Troubleshooting
The Output latching instructions above will provide a circuit similar to one common to digital electronics and digital logic. It is called the set-reset flip-flop. This operation has two well-defined states as shown in figure 2.1b.
SW1Latching switch / SW2
Unlatching switch / Output / Description
0 / 0 / 0 or 1 / Stays the same
0 / 1 / 0 / Reset to low
1 / 0 / 1 / Set to high
1 / 1 / ?? / Action is dependent on timing of when pressed
Figure 2.1b
The condition of the first state with both switches off will depend on the prior actions taken at the inputs. Whatever conditions lines two and three had produced, line one will not change. This means we really cannot predict the condition of the output without knowing the history of input activity. The fourth condition is avoided in the design of the use of the SET-RESET Latch. Sometimes it is possible to have a condition where both inputs are pressed at the same time but this should be physically unlikely or perhaps the condition would make no sense. For example, you would not press start and stop at the same time and expect a reasonable result.
This circuit is similar in some ways to the Sealing circuit discussed in the previous Section 1.4.8. The sealing circuit behavior is summarized in figure 2.1c.
PB1Latching
switch / PB2
Unlatching
switch / Output / Description
0 / 0 / 0 or 1 / Stays the same
0 / 1 / 0 / Resets the output
1 / 0 / 1 / Sets the output
1 / 1 / 0 / This is different from the latch circuit
Here 0 represents Unpressed Push button and 1 represents a pressed push button.
Figure 2.1c
Figure 2.1d: Ladder Diagram of Sealing Circuit
With the sealing circuit both switches are still N.O. push buttons, but the XIO command is used for the unlatching switch. Another difference is that the sealing circuit does not retain its output conditions after a power cycle event. This property of the Latch leads to it being referred to as a retentive circuit. When a circuit is retentive it holds the information even if turned on and off. The OTE command is non-retentive. The output is directly driven by its input logic. If the logic changes so does the output. The OTL and OTU, however, are retentive. These outputs are set by the input logic levels and hold their outputs even after the input changes. To change the output requires a separate command structure. This retentive behavior will also be seen in other commands later in the module.
Troubleshooting Outputs
When testing a program, it is possible that an output has not been properly designed to be turned on or off by the logic. However, you may need to determine if it can be turned on or off, or you may need to turn off a “stuck” output. The RSLogix software provides tools to allow direct manipulation of the outputs.
The ladder logic diagram below is of a latch circuit but there is no way to reset the latch.
Figure 2.1e: Latch Circuit
Figure 2.1f: “Stuck” Output
If the output is selected and then right clicked, the Pull down menu at the right will be seen. The important part for now is the last three entries. These entries will allow the Output selected to be forced on or off for testing, or to be toggled. A toggle means the condition is reversed, on goes to off and off goes to on. This is helpful when our reset circuit is not working or we need to test an output interface. It is also possible to force inputs on or off to test that the logic is correct but we may have a malfunctioning Input device.
Figure 2.1g: Pull down Menu
2.1.5Application:
Select one of the situations below, write the program and implement the program on your PLC. Use a Project Planning Sheet to document your work.
1. Set up a circuit using OTL and OTU to latch on three outputs with a single push button on SW0. The outputs should be on numbers 1,2, and 3. Set up a set of switches (1, 2, and 3) to turn off each output individually. This circuit would allow an operator to start a set of processes at the same time but manually controls the length of time each operates.
2. Build a set-reset circuit to turn on a sealing circuit. Use a different switch for the reset and the unseal operation.
3. In digital electronics a set-reset circuit often has two outputs. Each output is always the logic opposite of the other, often called Q and Q-not. Design a program to produce the Q and Q-not outputs with a set and reset switch for input.
Page 1