IMDHMIControls LibraryShop main store

How-to

Why two dock doors need closed-limit feedback in ladder logic

PLC programming Published 9 min read By IMDHMI controls team

Short answer

Give each door one permission bit and open it only when the opposite door's closed-limit input is made and no permission is held. Hold the permission from acceptance until that door has left and then re-made its closed limit. A normally closed contact on the opposite open limit fails because an absent open signal also covers a door still moving.

On this page
  1. Why does a normally closed contact on the other door's open limit fail?
  2. Which signals prove that a door is closed?
  3. What must the permission bit remember?
  4. How do I build the interlock in ladder logic?
  5. What do the permission rungs look like?
  6. What happens at power-up or when a limit switch fails?
  7. How do I test that both doors can never open together?
  8. Questions asked

Permit each dock door to open on exactly two conditions: the opposite door's closed-limit input is made, and the requesting door holds the single open permission. Keep one permission bit per door, set it when a request is accepted, and clear it only after that door has left and then re-made its own closed limit. A normally closed contact on the opposite door's open limit cannot do this job, because a missing open signal also describes a door that is still travelling. Both doors stay free to close at any time; only opening is gated. The sections below give the signal list, the arbitration rule, the rungs and the test that proves the exclusion.

Why does a normally closed contact on the other door's open limit fail? #

It fails because a missing open signal covers four door states at once — sealed, still travelling, open with a failed limit, or a broken circuit — and the interlock must pass only the first. The examine-off instruction sees one stored Boolean; the wiring, not the ladder symbol, decides what a false value means, and all four states write the same false into it.

Checking the opposite door's open-command output fails the same way: an output records what the PLC requested, a door can stand open after its command drops, and permission returning at that moment hands the second door the opening. A timer between commands separates requests in time and proves nothing about position, because travel varies with load, temperature and wear. Two requests landing together while both doors sit closed is the textbook race — two mutually exclusive events set off by one cause — and the scan has to resolve it deliberately, not through an accident of rung order.

Which signals prove that a door is closed? #

Only a closed-position limit switch at the sealed position, landed on its own PLC input, proves that a door is closed; the open limit, the open command and the operator's request each describe something else, and none of them can stand in for it. Build the point list first: for every external device record its function, voltage, I/O connection, program address and electrical state at each door position, then walk the list against the panel with a meter.

Signal What it is Wrong-value symptom
Closed confirmation Closed-position switch, true only at the sealed position A false-true frees the other door early; a false-false blocks it, the safe direction
Open indication Open-position feedback, if fitted Its absence used as closure proof frees the other door while this one moves
Open request Operator button or host command A held or stuck request fires the instant permission appears
Open command PLC output to the door controller Read back as position, it frees the interlock when the command ends, door still open
Permission Internal selection bit Two set at once: both doors leave closed together

An examine-on or examine-off instruction does not fix the physical contact arrangement; the wiring does. Wire each closed switch so the made contact drives the input on: a cut wire or failed switch then reads as not-closed, which blocks that door's own selection and blocks the opposite door — the failure direction you want, and the reason normalization comes before any permission rung. Where a door has both limits, treat both made at once as a fault.

What must the permission bit remember? #

Assign one permission bit per door at acceptance, hold it through opening, standing open and closing, and clear it only after that door has first left and then re-made its own closed limit; nothing shorter keeps the other door blocked for the whole cycle. The computer-science name for the requirement is mutual exclusion: one user never occupies the protected region while another is inside it. Here the protected region is anywhere off the closed limit, and exactly one door may be in it.

When both requests land in the same scan with both doors closed, give door 1 fixed priority and write the choice into door 2's set condition as door 1's request being off; the outcome then lives in the logic instead of depending on rung order. Discard a rejected request rather than queuing it — a stored request moves the door later with no fresh press, usually while someone is already loading through the opening that just freed the permission. Closing stays outside the permission entirely, and the one-at-a-time pattern scales past two units: the article on PLC motor interlock logic for three one-at-a-time motors shows the three-unit case.

How do I build the interlock in ladder logic? #

Work through eight steps in this order: point list, plain-English sequence, normalized closed bits, one arbitration decision, gated commands, a held permission with cycle memory, power-up recovery, and the witnessed test.

  1. Build the point list: every external device with its function, voltage, I/O connection, program address and electrical state at each door position, verified against the panel.
  2. Write the sequence in plain English on one page: how a request is accepted, what a simultaneous pair does, how long the permission is held, what closing requires, what releases the permission and what happens after a power loss. Get operations to agree to that page before any rung exists.
  3. Normalize the two closed bits so an internal TRUE means the door physically sits sealed, checked with the door closed, between limits and open. Express it the same way everywhere in the program.
  4. Make one arbitration decision: a single place in the scan that selects a request or rejects the conflict, placed before any command rung — never two independent rungs that can both qualify off the same all-closed state. If a conveyor runs through the opening, the stop-before-open sequencing in structuring dock door conveyor interlocks in Studio 5000 belongs in that same decision.
  5. Gate each open command three ways: the door's own permission, the opposite door's normalized closed bit, and the local permissives. Keep the open and close outputs of one actuator mutually exclusive, and give the door controller the command form its interface expects, maintained or pulsed.
  6. Hold the permission with cycle memory: latch a cycle bit the moment a permitted door leaves its closed limit, and clear the permission only when the cycle bit and the closed input stand together.
  7. Reconcile positions on the first scan after power-up, before any request is honored.
  8. Prove the result with a witnessed test and a trend of both closed inputs, both requests and both open commands.

One boundary belongs on the plain-English page: this interlock is operational sequencing, not safeguarding — bottom edges, photo-eyes and reversal stay with the door controller and its safety devices, whatever the PLC grants.

What do the permission rungs look like? #

The decision is eight short rungs: a set and a reset for each permission bit and for each cycle bit, with the cycle bit latching the moment a permitted door leaves its closed limit and dropping only when the permission clears. Every tag below is an example name of type BOOL, FALSE at power-up; map the assignments to your platform's set, reset and coil instructions, and place the permission rungs above the command rungs so a permission granted this scan drives its command in the same scan.

// Example tag names; all BOOL, FALSE at power-up

// Door 1: fixed priority when both requests land together
SET Permit_1 : Req_1 AND Closed_1 AND Closed_2 AND NOT Permit_2
RST Permit_1 : Cycle_1 AND Closed_1
SET Cycle_1  : Permit_1 AND NOT Closed_1
RST Cycle_1  : NOT Permit_1

// Door 2: door 1's request must be off in this same scan
SET Permit_2 : Req_2 AND NOT Req_1 AND Closed_1 AND Closed_2 AND NOT Permit_1
RST Permit_2 : Cycle_2 AND Closed_2
SET Cycle_2  : Permit_2 AND NOT Closed_2
RST Cycle_2  : NOT Permit_2

// Command rungs sit below, gated three ways
Open_Cmd_1 = Permit_1 AND Closed_2 AND Local_OK_1
Open_Cmd_2 = Permit_2 AND Closed_1 AND Local_OK_2

// First scan only: reconcile positions before any request
SET Permit_1, Cycle_1 : NOT Closed_1 AND Closed_2
SET Permit_2, Cycle_2 : NOT Closed_2 AND Closed_1

If a request can be held — a jammed pushbutton is the classic case — qualify the set rung with the request's rising edge, or require the request to drop before that door can be selected again; otherwise a held request recycles the door the moment its permission clears.

Illustrative numbers show why the cycle bit exists. Take a 10 ms scan and a door that needs about 200 ms to break its seal after the command: the closed input stays true for 200 ms ÷ 10 ms = 20 scans after Open_Cmd_1 goes true. A reset written as Permit_1 AND Closed_1 would clear the permission inside those 20 scans while door 1 is already moving, and door 2's gate would open onto it. With the cycle bit, Cycle_1 cannot set until Closed_1 first drops, so the reset stays unreachable until the door has travelled and truly returned. The same arithmetic covers the race: requests 30 ms apart land 30 ms ÷ 10 ms = 3 scans apart, and door 2's set rung, three scans later, reads Permit_1 made and rejects.

What happens at power-up or when a limit switch fails? #

On the first scan, reconcile positions before any permission exists: both doors confirmed closed leaves both permissions clear; one door off its closed limit assigns the permission to that door and blocks the other; feedback that cannot be true, such as both limits made, inhibits both open commands. With door 1 standing open when power returns, the first-scan rung sets Permit_1 and Cycle_1 together — setting the cycle bit matters, because without it the permission could never meet its own release condition and door 2 would be blocked for good.

The open door then holds the permission until somebody closes it, which is the correct behavior with no one at the buttons. A failed closed-limit circuit cannot be told from a moving or standing-open door, and the logic handles both the same way: the permission it grants can never clear, so both doors stay blocked until the circuit is repaired — the failure shows itself as a lock-out, never as two doors open together.

How do I test that both doors can never open together? #

Trend six signals on one screen — both closed inputs, both requests, both open commands — and read the order of the state changes, not the final positions; the rung set passes only if the second open command never goes true while the first closed input is false.

  • Both doors closed, press door 2: it opens. Keep door 1's request held through door 2's whole cycle; door 1 must not move until door 2 has re-made its closed limit, and only a fresh press opens it.
  • Hold both buttons down together: door 1 opens, door 2 never leaves closed, and door 2 still needs a new press after door 1 is shut.
  • Drop control power and restore it with door 1 open: door 2's command stays blocked until door 1 is closed, and the trend shows Permit_1 and Cycle_1 set on the first scan.
  • Disconnect door 1's closed-limit wire: both open commands must be dead. Reconnect it and confirm the normalized bit with the door closed, between limits and open.
  • Run both doors down together: both must close at once, proving the permission bits never touch the closing rungs.

Save the trend of each test as commissioning evidence. The acceptance criterion is one line: scans with a second open command true while the first closed input is false — zero.

Questions asked

Can the doors still be closed at the same time?

Yes, and they must stay free to. The permission bits appear only in the opening rungs; the closing rungs carry their own permissives, such as a clear photo-eye and a healthy door controller, so both doors can travel down together. Never route a close command through the opposite door's permission: the interlock then becomes a lock-out that can trap a door open and tempt operators to defeat it.

What if a door has an open limit but no closed limit?

Fit a closed-position switch where the seal is made and land it on its own input; no arrangement of the existing open limit can separate closed from still moving, so the hardware gap cannot be closed in software. Record the new switch on the point list with its voltage, wiring and address before the permission rungs are written. Until it is installed, keep the opposite door's open command inhibited rather than granting it on a timer.

Is this interlock a safety function with a PL or SIL rating?

No. The permission bits are operational sequencing, and no Performance Level or SIL is claimed for them. Where a risk assessment demands a rated function, build it from safety-rated devices, such as a safety relay or safety controller reading its own switches, and leave this ladder to sequence. The door's bottom edge, light curtain and reversal belong to the door controller and stay there whatever the PLC grants.

Should a rejected open request be stored until permission returns?

No; discard it and require a fresh press once the other door is confirmed closed. A stored request moves the door with no new command, usually while someone is already inside the opening that freed the permission, and the operator never learns the request was refused. If operations truly need queueing, that belongs in a written operating requirement, with a lamp or horn announcing that a request is being held.

The closed limit chatters as the door seats; where does debouncing go?

On the input, not on the interlock. Use the input module's filter, or require the same state for two consecutive scans before the normalized closed bit changes, and leave the release rule alone: the permission clears on the cycle bit plus confirmed closure, never on a timed value. A chattering contact taken as position proof can release the permission while the door is still settling into its seal.

Keep reading

  • Explainer

    How SoapBox Snap runs ladder logic with USB I/O

    SoapBox Snap is a GPL-v3 Windows application that edits and executes ladder logic on the PC. It has no I/O of its own: every physical channel comes from a loaded driver, and the described release documents two — Phidgets USB devices and a Twitter web service. Commission the device path first with no load connected, and keep machine safety hardwired.

    PLC programming

  • How-to

    PLC motor interlock logic for three one-at-a-time motors

    Put an examine-off contact of each other motor's output bit into every motor rung, so each motor runs only while the other two outputs are off. With the example rung order, a simultaneous pair of start presses resolves to the first rung in the scan; the software interlock prevents commanded overlap and is not a safety function.

    PLC programming

  • How-to

    Program a two-pump station with flowmeter pulses on an FX3U

    Build the station in staged rungs: a master fault latch, a start/stop run latch, pump 1 on the level call, pump 2 after 30 s (T1 K300 on the 100 ms base) or on a pump 1 overload, and the flowmeter counted on high-speed counter C235 at up to 100 kHz, scaled to L/min as pulses per second × 60 ÷ K-factor.

    PLC programming