Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to check if either input A or input B is ON.
PLC Programming
if inputA [1] inputB then output := TRUE; end_if;
Attempts:
3 left
💡 Hint
Common Mistakes
Using AND instead of OR will require both inputs to be true.
Using NOT will invert the condition incorrectly.
Using XOR only returns true if exactly one input is true.
✗ Incorrect
The OR operator checks if either inputA or inputB is TRUE, which is the correct parallel logic condition.
2fill in blank
mediumComplete the code to set the output ON if either sensor1 or sensor2 is active.
PLC Programming
output := sensor1 [1] sensor2;Attempts:
3 left
💡 Hint
Common Mistakes
Using AND will only set output if both sensors are active.
Using XOR will exclude the case where both sensors are active.
✗ Incorrect
Using OR between sensor1 and sensor2 sets output to TRUE if either sensor is active.
3fill in blank
hardFix the error in the condition to correctly implement parallel logic with inputs X and Y.
PLC Programming
if X [1] Y then motor := TRUE; end_if;
Attempts:
3 left
💡 Hint
Common Mistakes
Using AND instead of OR changes the logic to series.
Using NAND or XOR changes the logic behavior.
✗ Incorrect
The OR operator correctly implements parallel logic by activating motor if either X or Y is true.
4fill in blank
hardFill both blanks to create a condition that turns on the alarm if either button1 or button2 is pressed.
PLC Programming
if button1 [1] button2 [2] TRUE then alarm := TRUE; end_if;
Attempts:
3 left
💡 Hint
Common Mistakes
Using AND will require both buttons pressed.
Using <> (not equal) is incorrect for this logic.
✗ Incorrect
Using OR between buttons and comparing the result to TRUE correctly checks if either button is pressed.
5fill in blank
hardFill all three blanks to create a parallel logic condition that sets light ON if sensorA or sensorB is active and override is OFF.
PLC Programming
if (sensorA [1] sensorB) [2] override [3] FALSE then light := TRUE; end_if;
Attempts:
3 left
💡 Hint
Common Mistakes
Using AND instead of OR between sensors changes logic.
Using <> instead of = for override check is incorrect.
✗ Incorrect
The condition uses OR to check sensors, AND to combine with override status, and compares override to FALSE.
