Free
3 min
Beginner 01 — Switch turns on Light
beginnerfundamentalscontactcoil
Ready to build this?
Sign up free — no credit card required. This scenario is included in the free tier.
Sign up to play this scenario →Already have an account? Log in
Briefing
Your first PLC program. When SWITCH is ON, LIGHT turns ON. When SWITCH is OFF, LIGHT turns OFF. That's it — one simple instruction. In Ladder, a normally-open contact reads SWITCH and a coil writes LIGHT. In Structured Text, the same logic is a direct assignment: LIGHT := SWITCH;
Objectives
- When SWITCH is true, LIGHT turns on
- When SWITCH is false, LIGHT turns off
Hints
- Structured Text: write the output tag on the left of := and the input tag on the right. Ladder: place a normally-open SWITCH contact on the left.
- Structured Text statements end with a semicolon. Ladder: place the LIGHT output coil on the right.
I/O Table
Inputs
SWITCHPush-button switch (NO)
BOOL · %I0.0
Outputs
LIGHTIndicator lamp
BOOL · %Q0.0
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1SWITCH true → LIGHT on
Closing the switch turns on the light
- #2SWITCH false → LIGHT off
Opening the switch turns off the light
Related scenarios
Ready to build this?
Sign up free — no credit card required. This scenario is included in the free tier.
Sign up to play this scenario →Already have an account? Log in