Complete the code to start the motor when the start button is pressed.
IF StartButton = [1] THEN Motor := TRUE; END_IF;The start button is pressed when its value is 1 (true). So the condition checks if StartButton equals 1.
Complete the code to stop the motor when the stop button is pressed.
IF StopButton = [1] THEN Motor := FALSE; END_IF;The stop button is pressed when its value is 1, so the motor stops when StopButton equals 1.
Fix the error in the code to keep the motor running after pressing start until stop is pressed.
IF StartButton = 1 THEN Motor := TRUE; ELSIF StopButton = [1] THEN Motor := FALSE; END_IF;
The motor should stop when the stop button is pressed, which means StopButton equals 1.
Fill both blanks to create a condition that runs the motor only if start is pressed and stop is not pressed.
IF StartButton = [1] AND StopButton = [2] THEN Motor := TRUE; ELSE Motor := FALSE; END_IF;
The motor runs when StartButton is pressed (1) and StopButton is not pressed (0).
Fill all three blanks to create a latch that keeps the motor running after start is pressed until stop is pressed.
IF StartButton = [1] THEN Motor := TRUE; ELSIF StopButton = [2] THEN Motor := FALSE; ELSE Motor := [3]; END_IF;
The motor starts when StartButton is 1, stops when StopButton is 1, otherwise keeps its last state (Motor).
