Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to read the status of input 1.
PLC Programming
IF Input[1] THEN
Output1 := TRUE;
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Using input number 0 which may not exist.
Confusing input numbers with output numbers.
✗ Incorrect
Input 1 is referenced as Input1 in the PLC code to check its status.
2fill in blank
mediumComplete the code to reset the alarm flag.
PLC Programming
IF ResetButton = TRUE THEN
AlarmFlag := [1];
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Setting the flag to TRUE instead of FALSE.
Using numeric values instead of boolean.
✗ Incorrect
To reset the alarm flag, it should be set to FALSE.
3fill in blank
hardFix the error in the code to start the motor when the start button is pressed.
PLC Programming
IF StartButton = TRUE THEN
MotorStatus := [1];
END_IF;Attempts:
3 left
💡 Hint
Common Mistakes
Setting MotorStatus to FALSE or 0 which stops the motor.
Using numeric values instead of boolean TRUE.
✗ Incorrect
MotorStatus should be set to TRUE to start the motor when the button is pressed.
4fill in blank
hardFill both blanks to check if sensor value is above threshold and set alarm.
PLC Programming
IF SensorValue [1] Threshold THEN Alarm := [2]; END_IF;
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' for comparison.
Setting Alarm to FALSE instead of TRUE.
✗ Incorrect
The code checks if SensorValue is greater than Threshold and sets Alarm to TRUE.
5fill in blank
hardFill all three blanks to create a loop that checks inputs and sets outputs accordingly.
PLC Programming
FOR [1] := [3] TO [2] DO IF Inputs[[1]] = TRUE THEN Outputs[[1]] := TRUE; END_IF; END_FOR;
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong loop variable names.
Incorrect loop range values.
✗ Incorrect
The loop variable 'i' runs from 1 to 10, checking each input and setting the corresponding output.
