Bird
Raised Fist0
PLC Programmingscripting~20 mins

Level control system in PLC Programming - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Level Control Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this ladder logic snippet controlling a tank level?
Given a tank with a high-level sensor (HL) and a low-level sensor (LL), the ladder logic below controls a pump (PUMP). What is the state of PUMP after the sensors read HL=0 and LL=1?
PLC Programming
(* Ladder logic *)
|----[LL]----|----(PUMP)----|
|----[HL]----|----|/|--------|
APUMP is ON
BPUMP state is undefined
CPUMP toggles ON and OFF rapidly
DPUMP is OFF
Attempts:
2 left
💡 Hint
Think about how the low-level sensor and high-level sensor inputs affect the pump coil.
📝 Syntax
intermediate
2:00remaining
Which of these Structured Text (ST) code snippets correctly implements a level control ON/OFF logic?
You want to turn ON a pump when the level is below 30% and turn it OFF when the level is above 70%. Which code snippet correctly implements this?
AIF Level < 30 THEN Pump := TRUE; ELSEIF Level > 70 THEN Pump := FALSE; END;
BIF Level < 30 THEN Pump = TRUE ELSEIF Level > 70 THEN Pump = FALSE END_IF
CIF Level < 30 THEN Pump := TRUE ELSE IF Level > 70 THEN Pump := FALSE END_IF;
DIF Level < 30 THEN Pump := TRUE; ELSIF Level > 70 THEN Pump := FALSE; END_IF;
Attempts:
2 left
💡 Hint
Check the correct syntax for IF statements and assignment in Structured Text.
🔧 Debug
advanced
2:00remaining
Why does this PLC program cause the pump to never turn OFF?
The program below is intended to turn ON the pump when level < 40 and turn OFF when level > 80. However, the pump never turns OFF once ON. Identify the bug.
PLC Programming
IF Level < 40 THEN
  Pump := TRUE;
ELSIF Level > 80 THEN
  Pump := FALSE;
END_IF;
// Pump variable is BOOL
AThe ELSIF condition is incorrect; it should be ELSE IF.
BThe program lacks hysteresis, causing the pump to stay ON once turned ON.
CThe Pump variable is not initialized to FALSE at start.
DThe END_IF statement is missing a semicolon.
Attempts:
2 left
💡 Hint
Think about what happens when level is between 40 and 80.
🚀 Application
advanced
2:00remaining
How many times will the pump turn ON in this simulation?
A tank level sensor triggers pump ON when level < 25 and pump OFF when level > 75. The level changes as: 100, 20, 30, 10, 80, 70, 20, 90. How many times does the pump turn ON?
A3 times
B4 times
C2 times
D5 times
Attempts:
2 left
💡 Hint
Count transitions from level above 25 to below 25 that cause pump ON.
🧠 Conceptual
expert
2:00remaining
What is the main advantage of using hysteresis in a level control system?
Why do level control systems often use two different thresholds (e.g., ON at 30%, OFF at 70%) instead of a single threshold?
ATo allow manual override of the pump control during maintenance.
BTo reduce the power consumption of the pump by running it less frequently.
CTo prevent rapid switching of the pump caused by small fluctuations around a single threshold.
DTo synchronize multiple pumps running in parallel.
Attempts:
2 left
💡 Hint
Think about what happens if the level hovers near one threshold.

Practice

(1/5)
1. What is the main purpose of a level control system in a tank?
easy
A. To measure the temperature of the liquid
B. To keep the liquid level within safe limits automatically
C. To change the color of the liquid
D. To increase the pressure inside the tank

Solution

  1. Step 1: Understand the system goal

    A level control system is designed to maintain liquid levels safely.
  2. Step 2: Identify the correct function

    It uses sensors and pumps to keep levels steady, not temperature or color.
  3. Final Answer:

    To keep the liquid level within safe limits automatically -> Option B
  4. Quick Check:

    Level control = safe liquid level [OK]
Hint: Focus on what 'level control' means in real life [OK]
Common Mistakes:
  • Confusing level control with temperature control
  • Thinking it changes liquid properties
  • Assuming it controls pressure
2. Which of the following is the correct simple IF statement to turn ON a pump when the level is below 30%?
easy
A. IF level = 30 THEN pump = OFF;
B. IF level > 30 THEN pump = ON;
C. IF level < 30 THEN pump = ON;
D. IF level <= 30 THEN pump = OFF;

Solution

  1. Step 1: Understand the condition for turning pump ON

    The pump should turn ON when level is below 30% to fill the tank.
  2. Step 2: Match the correct syntax

    IF level < 30 THEN pump = ON; correctly uses IF level < 30 THEN pump = ON;
  3. Final Answer:

    IF level < 30 THEN pump = ON; -> Option C
  4. Quick Check:

    Turn ON pump if level less than 30% [OK]
Hint: Pump ON when level is less, so use '<' operator [OK]
Common Mistakes:
  • Using > instead of < for turning pump ON
  • Confusing ON and OFF states
  • Using equality instead of inequality
3. Given this PLC logic snippet:
IF level < 40 THEN pump = ON;
ELSE pump = OFF;

What will be the pump state if the level sensor reads 45?
medium
A. Pump will be ON
B. Pump will stay in previous state
C. Pump state will toggle rapidly
D. Pump will be OFF

Solution

  1. Step 1: Check the condition with level = 45

    Since 45 is not less than 40, the IF condition is false.
  2. Step 2: Follow the ELSE branch

    Because IF is false, pump = OFF is executed.
  3. Final Answer:

    Pump will be OFF -> Option D
  4. Quick Check:

    Level 45 ≥ 40 means pump OFF [OK]
Hint: Check IF condition with given value carefully [OK]
Common Mistakes:
  • Assuming pump stays ON without checking ELSE
  • Confusing < and > operators
  • Ignoring ELSE branch
4. Identify the error in this PLC code snippet for level control:
IF level > 70 THEN pump = ON;
ELSE pump = ON;
medium
A. Pump is always ON regardless of level
B. Syntax error: missing ENDIF
C. Pump never turns ON
D. Level sensor value is not checked

Solution

  1. Step 1: Analyze the IF and ELSE assignments

    Both IF and ELSE branches set pump = ON, so pump is always ON.
  2. Step 2: Understand the logic flaw

    This means pump never turns OFF, ignoring level changes.
  3. Final Answer:

    Pump is always ON regardless of level -> Option A
  4. Quick Check:

    Same action in IF and ELSE means no control [OK]
Hint: Check if IF and ELSE do different things [OK]
Common Mistakes:
  • Thinking ELSE is missing
  • Assuming pump turns OFF somewhere
  • Ignoring logic duplication
5. You want to design a level control system that turns ON the pump when level is below 30%, turns OFF when above 70%, and keeps the pump state unchanged between 30% and 70%. Which logic correctly implements this?
hard
A. IF level < 30 THEN pump = ON; ELSE IF level > 70 THEN pump = OFF;
B. IF level <= 70 THEN pump = OFF; ELSE pump = ON;
C. IF level < 30 THEN pump = ON; ELSE pump = OFF;
D. IF level > 70 THEN pump = ON; ELSE IF level < 30 THEN pump = OFF;

Solution

  1. Step 1: Understand the required behavior

    Turn pump ON below 30%, OFF above 70%, and keep state unchanged between 30% and 70%.
  2. Step 2: Analyze each option

    IF level < 30 THEN pump = ON; ELSE IF level > 70 THEN pump = OFF; turns ON if level < 30, OFF if level > 70, and does nothing in between (keeps state).
  3. Final Answer:

    IF level < 30 THEN pump = ON; ELSE IF level > 70 THEN pump = OFF; -> Option A
  4. Quick Check:

    Two conditions control pump ON/OFF, else no change [OK]
Hint: Use two IFs for ON and OFF, no ELSE for unchanged [OK]
Common Mistakes:
  • Turning pump OFF immediately below 70%
  • Not handling the middle range correctly
  • Reversing ON and OFF conditions
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard