Compare 01 — High temperature lamp
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
Not ready to sign up? Run a live lab now — no signup →
Briefing
TANK_TEMP_C is a number: the tank temperature in whole degrees C. HIGH_TEMP_LAMP must be on when it is above 80, and off otherwise. A comparison contact passes power only while its test is true. Mind the boundary: exactly 80 is not above 80. Use the input panel to type readings and watch the lamp. The Diagram tab has no comparison contact. Write the rung in the Code tab, with the comparison in brackets, for example | (SPEED > 5) | := FAST ;
Objectives
- Temperature 80 or lower: HIGH_TEMP_LAMP off
- Temperature above 80 (81, 150, ...): HIGH_TEMP_LAMP on
- The lamp follows the reading live, on and off again
Hints
- A number cannot be a plain contact. You need a contact that tests the number against a limit.
- The lamp is for temperatures higher than the limit. Decide which comparison says "higher than".
- Try the awkward readings yourself in the input panel: exactly 80, then 81. They must give different answers.
- If the lamp lights at exactly 80, your comparison includes the boundary. The rule is above 80, not 80 and above.
I/O Table
Inputs
TANK_TEMP_CTank temperature, whole degrees C
INT · %IW0
Outputs
HIGH_TEMP_LAMPHigh temperature lamp
BOOL · %Q0.0
Your program will be tested against:
All test cases run automatically when you submit. Assertions are hidden until you pass.
- #1Temperature 50 → lamp off
A normal temperature leaves the lamp off
- #2Temperature exactly 80 → lamp off
The limit itself is not "above 80"
- #3Temperature 81 → lamp on
One degree above the limit lights the lamp
- #4Temperature 150 → lamp on
Any reading above the limit lights the lamp
- #5Falls back to 79 → lamp off again
The lamp follows the reading live; it does not stay on
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
Not ready to sign up? Run a live lab now — no signup →