Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to check if input A equals input B.
PLC Programming
IF A [1] B THEN
OUTPUT := TRUE;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using NE instead of EQ will check for not equal.
Using GT or LT checks greater or less, not equality.
✗ Incorrect
The EQ instruction checks if two values are equal.
2fill in blank
mediumComplete the code to check if sensor value is greater than threshold.
PLC Programming
IF SensorValue [1] Threshold THEN
Alarm := TRUE;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using LT will check if SensorValue is less than Threshold.
Using EQ checks equality, not greater than.
✗ Incorrect
GT means greater than, so it checks if SensorValue is above Threshold.
3fill in blank
hardFix the error in the code to check if counter is not equal to max value.
PLC Programming
IF Counter [1] MaxValue THEN
Reset := TRUE;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using EQ will check if Counter equals MaxValue, which is opposite.
Using GT or LT checks greater or less, not inequality.
✗ Incorrect
NE means not equal, so it correctly checks if Counter is different from MaxValue.
4fill in blank
hardFill both blanks to check if temperature is less than limit and pressure is not equal to zero.
PLC Programming
IF Temperature [1] Limit AND Pressure [2] 0 THEN Warning := TRUE; END_IF;
Attempts:
3 left
💡 Hint
Common Mistakes
Using EQ instead of NE for Pressure will check equality, not inequality.
Using GT instead of LT for Temperature will check greater than, not less.
✗ Incorrect
LT checks if Temperature is less than Limit, NE checks if Pressure is not equal to zero.
5fill in blank
hardFill all three blanks to create a condition: speed greater than minSpeed, speed less than maxSpeed, and status not equal to errorCode.
PLC Programming
IF Speed [1] minSpeed AND Speed [2] maxSpeed AND Status [3] errorCode THEN Run := TRUE; END_IF;
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up GT and LT operators.
Using EQ instead of NE for status check.
✗ Incorrect
GT checks Speed > minSpeed, LT checks Speed < maxSpeed, NE checks Status != errorCode.
