PLC Logic Gates Tutorial 2026: How AND, OR, NOT, NAND and NOR Gates Work in Ladder Diagram Programming (Updated September 2026) (Updated September 2026)
Logic gates are the building blocks of every PLC program ever written — from a simple motor start/stop circuit at a Bajaj Auto Waluj machining cell to a complex interlocking system at Skoda VW's Shendra paint shop. Here's what most PLC textbooks don't tell you: you don't need to think in gates to write great ladder diagrams. What you actually need is to understand how each gate's truth table translates to contact and coil symbols on a ladder rung — and the moment that clicks, PLC programming stops feeling like a foreign language. The NASSCOM-Deloitte report projects 1.25 million automation professionals needed by 2027, and every single PLC interview in India will test your logic gate knowledge, usually with a paper-and-pen program. Let me walk you through all five in a way that actually sticks.
- In PLC ladder diagrams, an AND gate = contacts in series; an OR gate = contacts in parallel; a NOT gate = normally-closed (NC) contact
- A NAND gate = series contacts feeding a NOT (NC output coil); a NOR gate = parallel contacts feeding a NOT (NC output coil)
- Once you know these mappings, you can translate any logic gate combination into a ladder rung — and that is what PLC programming interviews test
- This tutorial covers all five gates with truth tables, ladder rung drawings, and real Siemens/Allen-Bradley examples
Logic Gates and PLC Programming: Why You Need to Understand Both
A logic gate is a circuit element (or software equivalent) that takes one or more binary inputs and produces a single binary output based on a defined rule. In PLC programming, every rung of a ladder diagram is actually implementing one or more logic gate functions — you're just drawing them in contact-and-coil notation instead of gate symbols. What most people don't realize is that PLC manufacturers deliberately designed ladder diagrams to look like relay logic (contacts and coils on a rung) so that relay-trained electricians could read and write PLC programs without learning Boolean algebra from scratch. The five gates every PLC programmer must know are AND, OR, NOT, NAND, and NOR. Each maps to a specific arrangement of contacts (inputs) and coils (outputs) on a ladder rung, and once you learn the mapping, creating and reading any ladder program becomes straightforward.

AND Gate in PLC Ladder Diagram: Series Contacts Explained
An AND gate produces a TRUE output only when ALL of its inputs are TRUE — if any input is FALSE, the output is FALSE. Truth table: A=0 B=0 → Q=0; A=0 B=1 → Q=0; A=1 B=0 → Q=0; A=1 B=1 → Q=1. In a PLC ladder diagram, the AND gate is implemented by placing contacts IN SERIES on a rung. Example: to energize a motor output coil (Q0.0) only when BOTH a start pushbutton (I0.0) AND a safety gate sensor (I0.1) are active, place both contacts on the same rung in series: |—[I0.0]—[I0.1]—( Q0.0 )—|. In Siemens TIA Portal, each contact is a LAD element; in Allen-Bradley Studio 5000, it's an Examine If Closed (XIC) instruction for each input. In the real world, the AND gate is the most common gate in PLC programs because industrial safety requires MULTIPLE conditions to be true before a machine can run — speed, position, door closed, E-stop not active, etc., all in series.
| Logic Gate | Truth Table Rule | Ladder Diagram Equivalent | Siemens TIA Portal | Allen-Bradley Studio 5000 | Industrial Use Example |
|---|---|---|---|---|---|
| AND | All inputs TRUE → TRUE | Contacts in SERIES | NO contacts in series | XIC in series | Motor starts only when start + guard + no-fault |
| OR | Any input TRUE → TRUE | Contacts in PARALLEL | Open branch | XIC in parallel | Either station 1 OR station 2 starts conveyor |
| NOT | Inverts input | Normally-CLOSED (NC) contact | NC contact (slash symbol) | XIO instruction | E-stop NC: machine runs unless stop pressed |
| NAND | All inputs TRUE → FALSE (else TRUE) | Series contacts → negated coil | Series NOs → NOT box / NC output | Series XICs → OTE with inverted tag | Safety valve: closes ONLY when ALL sensors simultaneously fail |
| NOR | All inputs FALSE → TRUE (else FALSE) | Parallel contacts → negated coil | Parallel NOs → NOT box | Parallel XICs → OTE inverted | All-clear lamp: ON only when zero faults active |
OR Gate in PLC Ladder Diagram: Parallel Contacts Explained
An OR gate produces a TRUE output when ANY of its inputs is TRUE — it only outputs FALSE when ALL inputs are FALSE. Truth table: A=0 B=0 → Q=0; A=0 B=1 → Q=1; A=1 B=0 → Q=1; A=1 B=1 → Q=1. In a PLC ladder diagram, the OR gate is implemented by placing contacts IN PARALLEL (multiple branches on the same rung). Example: a conveyor system where EITHER a pushbutton at station 1 (I0.0) OR a pushbutton at station 2 (I0.1) can start the conveyor motor (Q0.0): |—[I0.0]—|——( Q0.0 )—| with I0.1 in a parallel branch below. This is the pattern you'll see in machine panels where multiple operator stations can control the same output. In Siemens TIA Portal this is an open branch; in Allen-Bradley it's a parallel XIC rung. The OR gate combined with the AND gate covers about 80% of all industrial logic programming scenarios.

NOT Gate in PLC Ladder Diagram: The Normally-Closed Contact
A NOT gate (inverter) produces the opposite of its input — if input is TRUE, output is FALSE; if input is FALSE, output is TRUE. Truth table: A=0 → Q=1; A=1 → Q=0. In a PLC ladder diagram, the NOT gate is a NORMALLY-CLOSED (NC) contact — represented with a diagonal slash or a solidus through the contact symbol. Example: an emergency stop (E-stop) pushbutton wired as normally-closed — when the E-stop is not pressed (I0.2 = 0), the NC contact passes current (Q = 1, machine runs); when the E-stop is pressed (I0.2 = 1), the NC contact opens (Q = 0, machine stops). In Siemens TIA Portal, this is the Normally Closed contact (NCO) element; in Allen-Bradley it's the Examine If Open (XIO) instruction. What most beginners get wrong: the NC contact in the ladder corresponds to the NOT of the physical input state — NOT the physical wiring of the input device. You can wire a normally-open pushbutton as an input and use an NC contact in the program, which creates a NOT function in software.
NAND Gate in PLC Ladder Diagram: AND Logic with Inverted Output
A NAND gate is an AND gate followed by a NOT — it outputs FALSE only when ALL inputs are TRUE, and outputs TRUE in all other cases. Truth table: A=0 B=0 → Q=1; A=0 B=1 → Q=1; A=1 B=0 → Q=1; A=1 B=1 → Q=0. In ladder diagram, a NAND gate is contacts in series (AND) driving a NOT output coil. Example: a safety interlock that should de-energize a valve (Q0.3) ONLY when BOTH a pressure sensor (I0.3) AND a temperature sensor (I0.4) simultaneously go high: use two normally-open contacts (I0.3 and I0.4) in series, but wire the output to a NEGATED coil or use an OTE (Output Energize) coil and then invert the logic. In TIA Portal, you can use a NOT box or place the output as a negated coil. In real industrial practice, NAND logic appears in interlocks where multiple unsafe conditions all coinciding triggers a safety action — it's less common in basic conveyor control but essential in hydraulic and pneumatic press safety systems.
NOR Gate in PLC Ladder Diagram: OR Logic with Inverted Output
A NOR gate is an OR gate followed by a NOT — it outputs TRUE only when ALL inputs are FALSE; any TRUE input makes the output FALSE. Truth table: A=0 B=0 → Q=1; A=0 B=1 → Q=0; A=1 B=0 → Q=0; A=1 B=1 → Q=0. In ladder diagram, a NOR gate is contacts in parallel (OR) driving a negated output. Example: a lamp or alarm that should be ON only when ALL inputs are inactive — if any fault signal (I0.5 = drive fault, I0.6 = temperature alarm, I0.7 = door open) is active, the lamp should go OFF. Place I0.5, I0.6, I0.7 in parallel, then invert the output. In TIA Portal, the NOR is less commonly drawn as a single rung; more often it is implemented across two rungs: rung 1 activates a fault-flag coil via parallel contacts; rung 2 uses an NC contact of that flag to energize the all-clear lamp. This is the industry convention because it makes the ladder more readable for maintenance technicians.
Combining Logic Gates in a Real Industrial PLC Program
Real PLC programs rarely use just one gate type — they combine AND, OR, and NOT logic across multiple rungs to implement sequences, interlocks, and safety logic. Here's a practical example: a motor control circuit at an industrial machine that requires: (a) START button pressed (I0.0), AND (b) safety guard closed (I0.1), AND (c) E-stop NOT pressed (I0.2 NC), OR (d) motor already running (seal-in via Q0.0 auxiliary contact). The ladder rung looks like: |—[I0.2/NC]——[I0.1]——[(I0.0 OR Q0.0)]——(Q0.0)—|. This one rung combines a NOT (I0.2 NC), an AND (with I0.1), and an OR (start button or self-seal) into a single motor control circuit. In Siemens TIA Portal, this is a typical first programming exercise; at Bajaj Auto or Endurance interviews, you may be asked to write exactly this on paper. The best practice for complex programs: draw the truth table first, identify the gate structure, then translate to ladder — even experienced programmers do this for unfamiliar logic combinations.
ABC Trainings is a CMYKPY and PMKVY 4.0 empanelled training partner in Maharashtra. Eligible students in the Industry 4.0 with AI & Industrial Automation program receive ₹6,000–₹10,000 per month in skill development stipend under the Chief Minister Yuva Karmashin Yojana — helping fund training in PLC, SCADA, drives, and EPLAN at minimal personal cost while building skills for AURIC and Pune industrial belt jobs.Get the Industrial Automation Brochure + Fees + Batch Dates on WhatsApp
Free 1:1 counselling. Placement track record. CMYKPY/PMKVY eligibility check.
๐ฌ Get Brochure on WhatsApp๐ Call 7039169629About the author: Sunil Wagh. Sunil Wagh has trained over 1,200 diploma and degree engineers in PLC, SCADA, EPLAN, and industrial automation across ABC Trainings centres in Pune and Sambhajinagar. He brings 15 years of hands-on automation project experience with Siemens, L&T, and MIDC-region manufacturers..
Visit Our Centers
- Wagholi (Pune): 1st Floor, Laxmi Datta Arcade, Pune-Ahilyanagar Highway. Call 7039169629
- Hadapsar (Pune HQ): 1st Floor, Shree Tower, opp. Vaibhav Theater, Magarpatta. Call 7039169629
- Cidco (Chh. Sambhajinagar): Kalpana Plaza, opp. Eiffel Tower, N-1 Cidco. Call 7039169629
- Osmanpura (Chh. Sambhajinagar): S.S.C Board to Peer Bazar Road, near Jama Masjid. Call 7039169629
- Sangli: Shubham Emphoria, 1st Floor, Above US Polo Assn., Sangli-Miraj Rd, Vishrambag. Weekend batches available. Call 7039169629
FAQs
How is an AND gate represented in a PLC ladder diagram?
An AND gate in a PLC ladder diagram is represented by contacts placed in SERIES on a rung. Both (or all) series contacts must be closed (logic 1) for current to flow and energize the output coil. In Siemens TIA Portal, this is a chain of Normally Open (NO) contact elements in a single rung path; in Allen-Bradley Studio 5000, it is Examine If Closed (XIC) instructions in series.
What is the difference between normally-open and normally-closed contacts in PLC ladder logic?
A normally-open (NO) contact passes current when its associated input tag is TRUE (logic 1) — it represents the state of the input directly. A normally-closed (NC) contact passes current when its associated input tag is FALSE (logic 0) — it is the NOT gate equivalent in ladder logic. The NC contact is the fundamental building block for E-stop, overload, and interlock logic in every industrial PLC program.
Which logic gate is most commonly used in industrial PLC programs?
The AND gate (series contacts) is the most commonly used logic gate in industrial PLC programs, because most industrial interlocks require MULTIPLE conditions to be simultaneously TRUE before a machine action is allowed — "motor can only run if start is pressed AND guard is closed AND E-stop is not active AND drive is healthy." This multi-condition AND structure is the backbone of nearly every machine safety sequence.
Is ABC Trainings' PLC course good for learning ladder logic programming from scratch?
Yes, ABC Trainings' Industry 4.0 with AI & Industrial Automation program starts with ladder diagram fundamentals — contacts, coils, timers, counters, and logic gates — before moving to Siemens TIA Portal and Allen-Bradley Studio 5000 programming on real hardware. The program is structured for freshers (diploma/degree electrical/electronics engineers) with no prior PLC experience. Batches run at Pune (Wagholi, Hadapsar) and Sambhajinagar (CIDCO). Call 7039169629 for the next batch date.
