Normally open (NO) contact in PLC Programming - Time & Space Complexity
We want to understand how the time it takes to check a normally open (NO) contact changes as the number of contacts grows.
How does the program's work increase when more NO contacts are checked in sequence?
Analyze the time complexity of the following code snippet.
// Example of checking multiple NO contacts in sequence
FOR i := 1 TO n DO
IF NO_Contact[i] = TRUE THEN
Output := TRUE;
ELSE
Output := FALSE;
END_IF;
END_FOR;
This code checks each normally open contact one by one to decide the output.
Identify the loops, recursion, array traversals that repeat.
- Primary operation: Checking each NO contact's state.
- How many times: Once for each contact, so n times.
As the number of contacts increases, the program checks more contacts one after another.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 checks |
| 100 | 100 checks |
| 1000 | 1000 checks |
Pattern observation: The number of operations grows directly with the number of contacts.
Time Complexity: O(n)
This means the time to check all NO contacts grows in a straight line as you add more contacts.
[X] Wrong: "Checking multiple NO contacts takes the same time no matter how many there are."
[OK] Correct: Each contact must be checked one by one, so more contacts mean more work and more time.
Understanding how checking multiple contacts affects time helps you design efficient control logic and shows you can think about program speed in real systems.
"What if we checked NO contacts in parallel instead of one by one? How would the time complexity change?"
Practice
Normally Open (NO) contact do in a PLC circuit?Solution
Step 1: Understand NO contact default state
A Normally Open contact is open by default, meaning no current flows through it initially.Step 2: Behavior when activated
When the NO contact is activated (e.g., button pressed), it closes, allowing current to flow.Final Answer:
It remains open until activated, then closes to allow current flow. -> Option AQuick Check:
NO contact = open by default, closes when activated [OK]
- Confusing NO with Normally Closed (NC) contact
- Thinking NO contact is closed by default
- Assuming NO contact always stays open
Solution
Step 1: Identify NO contact symbol
The Normally Open contact is represented by two parallel vertical lines:| |.Step 2: Differentiate from NC contact
The Normally Closed contact uses|/|or--[/]--symbols, which are different.Final Answer:
| |symbol -> Option CQuick Check:
NO contact =| |[OK]
- Using NC contact symbol for NO contact
- Confusing ladder logic symbols
- Mixing up contact and coil symbols
Start_Button controlling a coil Motor, what happens when Start_Button is pressed?
--| |--( )-- Start_Button Motor
Solution
Step 1: Analyze NO contact behavior when pressed
Pressing theStart_Buttoncloses the NO contact, allowing current to flow.Step 2: Effect on coil
Current energizes theMotorMotorcoil, turning the motor ON.Final Answer:
Motor coil energizes, turning the motor ON. -> Option BQuick Check:
NO contact pressed = coil energized [OK]
- Assuming coil de-energizes when NO contact closes
- Thinking NO contact does not affect coil
- Confusing coil with contact behavior
Sensor is supposed to start the Conveyor motor. However, the motor never starts even when the sensor is triggered. What is the likely error?
--|/|--( )-- Sensor Conveyor
Solution
Step 1: Identify contact type in code
The contact symbol|/|represents a Normally Closed (NC) contact, not Normally Open (NO).Step 2: Effect of NC contact on motor start
Since the sensor is triggered (activated), the NC contact opens, breaking the circuit and preventing the motor from starting.Final Answer:
The contact is Normally Closed (NC) instead of Normally Open (NO). -> Option AQuick Check:
Wrong contact type = motor won't start [OK]
- Confusing NC and NO contact symbols
- Assuming coil wiring is always the issue
- Ignoring sensor physical connection
Solution
Step 1: Understand NO contact behavior in start circuit
A Normally Open start button is open by default, meaning no current flows through it initially (machine OFF).Step 2: Effect of pressing NO start button
When the NO button is pressed, it closes, allowing current to flow and energizing the motor coil to start the machine.Final Answer:
Use the NO contact in series with the motor coil; pressing the button energizes the coil to start the machine. -> Option DQuick Check:
NO series press = coil energized to start [OK]
- Placing NO contact in parallel for start function
- Assuming pressing NO button breaks circuit to start
- Confusing NO and NC contacts in control circuits
Ready to prove it?
Pass the test and this pattern moves unknown
