With an Allen-Bradley PLC, the terms latch and unlatch are used. Figure 7.15 shows the ladder diagram.
The SET and RESET coil symbols are often combined in a single box symbol. Figure 7.16 shows the equivalent ladder diagram for the set-reset function in the preceding figures with a Siemens PLC. The term memory box is used by them for the SET/RESET box, and the box shown is termed an SR or reset priority memory function in that reset has priority.With set priority (RS memory box), the arrangement is as shown in Figure 7.17.The programming instructions (F indicates an internal relay) for reset priority are: A I0.0 S F0.0 A I0.1 R F0.0 A F0.0 1?4 Q2.0
Toshiba uses the term flip-flop, and Figure 7.18 shows the ladder diagram.
Figure 7.19 shows how the set-reset function can be used to build the pulse (one-shot)function described in the previous section. Figure 7.19a shows it for a Siemens PLC(F indicates internal relay) and Figure 7.19b for a
Telemecanique PLC (B indicates internal relay). In Figures 7.19a and 7.19b, an input (I0.0, I0,0) causes the internal relay (B0, F0.0)in the first rung to be activated. This results in the second rung, in the set/reset internal relay being set. This setting action results in the internal relay (F0.1, B1) in the first rung opening,and so, despite there being an input in the first rung, the internal relay (BO, F0.0) opens.
However, because the rungs are scanned in sequence from top to bottom, a full cycle must
elapse before the internal relay in the first rung opens. A pulse of duration one cycle has thus been produced. The system is reset when the input (I0.0, I0,0) ceases.
7.5.1 Program Examples
An example of the basic elements of a simple program for use with a fire alarm system is shown in Figure 7.20. Fire sensors provide inputs to a SET/RESET function block so that if one of the sensors is activated, the alarm is set and remains set until it is cleared by being reset. When set it sets off the alarm.
Another program showing the basic elements of a program is shown in Figure 7.21. This could be used with a system designed to detect when a workpiece
has been loaded into the correct position for some further operation. When the start contacts are closed, the output causes the workpiece to move. This continues until a light beam is interrupted and resets,causing the output to cease. A stop button is available to stop the movement at any time.
7.6 Master Control Relay
When large numbers of outputs have to be controlled, it is sometimes necessary for whole sections of ladder diagrams to be turned on or off when certain criteria are realized. This could be achieved by including the contacts of the same internal relay in each of the rungs so that its operation affects all of them. An alternative is to use a master control relay.
Figure 7.22 illustrates the use of such a relay to control a section of a ladder
program.With no input to input In 1, the output internal relay MC 1 is not energized, and so its contacts are open. This means that all the rungs between where it is designated to operate and the rung on which its reset MCR or another master control relay is located are switched off.
Assuming that it is designated to operate from its own rung, we can imagine it to be located in the power line in the position shown, and so rungs 2 and 3 are off. When input In 1 contacts close, the master relay MC 1 is energized. When this happens, all the rungs between it and the rung with its reset MCR 1 are switched on. Thus outputs Out 1 and
Out 2 cannot be switched on by inputs In 2 and In 3 until the master control relay has been switched on. The master control relay MC 1 acts only over the region between the rung it is designated to operate from and the rung on which MCR 1 is located.
With a Mitsubishi PLC, an internal relay can be designated as a master control relay by programming it accordingly. Thus to program an internal relay M100 to act as a master control relay, the program instruction is: MC M100
To program the resetting of that relay, the program instruction is: MCR M100
Thus for the ladder diagram shown in Figure 7.23, which is Figure 7.22 with Mitsubishi
addresses, the program instructions are: