Complete the code to start the washing machine when the start button is pressed.
IF start_button = [1] THEN
motor := TRUE;
END_IF;The start button must be TRUE (pressed) to start the motor.
Complete the code to stop the motor when the stop button is pressed.
IF stop_button = [1] THEN
motor := FALSE;
END_IF;The motor stops when the stop button is pressed, which means stop_button is TRUE.
Fix the error in the code to correctly check if the water level is high.
IF water_level [1] high_level THEN
valve := FALSE;
END_IF;In PLC programming, '=' is used to compare equality, ':=' is assignment.
Fill both blanks to create a loop that runs the motor for 30 seconds.
timer := [1]; IF timer [2] 30 THEN motor := FALSE; END_IF;
The timer is started with start_timer(), and the motor stops when timer > 30 seconds.
Fill all three blanks to create a dictionary that maps cycle names to their durations in minutes.
cycles := {"wash": [1], "rinse": [2], "spin": [3];The wash cycle lasts 30 minutes, rinse 10 minutes, and spin 5 minutes.
