## PLC Lab Exercise Logic Gates, PLC Ladder Logic Diagram Examples ## Logic Gates using PLC Programming [Explained with Ladder Diagram] To understand programmable logic controllers PLCs and their applications, you must first understand the logic concepts behind them. The binary concept shows how physical quantities binary variables that can exist in one of two states can be represented as 1 or 0. Programmable logic controllers PLCs make decisions based on the results of these kinds of logical statements. These functions combine binary variables to form statements. There are many control situations requiring actions to be initiated when a certain combination of conditions is realized. Thus, for an automatic drilling machinethere might be the condition that the drill motor is to be activated when the limit switches are activated that indicate the presence of the workpiece and the drill position as being at the surface of the workpiece. Such a situation involves the AND logic functioncondition A and condition B having both to be realized for an output to occur. This section is a consideration of such logic functions. Figure 1a shows a situation where an output is not energized unless two, normally open, switches are both closed. We can think of this as representing a control system with two inputs A and B Figure 1b. Only when A and B are both on is there an output. Thus if we use 1 to indicate an on signal and 0 to represent an off signalthen for there to be a 1 output we must have A and B both 1. Such an operation is said to be controlled by a logic gate and the relationship between the inputs to a logic gate and the outputs is tabulated in a form known as a truth table. An example of an AND gate is an interlock control system for a machine tool so that it can only be operated when the safety guard is in position and the power switched on. The ladder diagram starts witha normally open set of contacts labeled input A, to represent switch A and in series with itanother normally open set of contacts labeled input B, to represent switch B. The line then terminates with O to represent the output. For there to be an output, both input A and input B have to occur, i. Figure 3a shows an electrical circuit where an output is energized when switch A or B, both normally open, are closed. This describes an OR logic gate Figure 3b in that input A or input B must be on for there to be an output. Figure The ladder diagram starts withnormally open contacts labeled input Ato represent switch A and in parallel with itnormally open contacts labeled input B, to represent switch B. An example of an OR gate control system is a conveyor belt transporting bottled products to packaging where a deflector plate is activated to deflect bottles into a reject bin if either the weight is not within certain tolerances or there is no cap on the bottle. Figure 5a shows an electrical circuit controlled by a switch that is normally closed. When there is an input to the switch, it opens and there is then no current in the circuit. This illustrates a NOT gate in that there is an output when there is no input and no output when there is an input Figure 5c. The gate is sometimes referred to as an inverter. 