Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the screen title in an HMI project.
PLC Programming
screen.title = "[1]"
Attempts:
3 left
💡 Hint
Common Mistakes
Using control names like 'Start Button' as the screen title.
Leaving the title blank or generic.
✗ Incorrect
The screen title should describe the screen purpose, such as 'Main Screen'.
2fill in blank
mediumComplete the code to create a button that starts a motor when pressed.
PLC Programming
button.action = "[1]"
Attempts:
3 left
💡 Hint
Common Mistakes
Using stop_motor() which stops the motor instead of starting it.
Using unrelated functions like reset_alarm().
✗ Incorrect
The button should trigger the start_motor() function to start the motor.
3fill in blank
hardFix the error in the code to display the temperature value on the HMI screen.
PLC Programming
display.text = sensor.[1]Attempts:
3 left
💡 Hint
Common Mistakes
Using 'status' which might be a string like 'OK' or 'Error'.
Using 'name' or 'type' which are descriptive, not numeric values.
✗ Incorrect
The 'value' property holds the current temperature reading from the sensor.
4fill in blank
hardFill both blanks to create a conditional color change for a warning light on the HMI.
PLC Programming
if temperature [1] [2]: warning_light.color = "red"
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' which would trigger the warning for low temperature.
Using 50 which is a lower threshold than intended.
✗ Incorrect
The warning light should turn red if temperature is greater than 75 degrees.
5fill in blank
hardFill all three blanks to create a dictionary mapping sensor names to their values, filtering only active sensors.
PLC Programming
sensor_data = { [1]: [2] for [3] in sensors if [3].status == 'active' }Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent variable names in the comprehension.
Not filtering by sensor.status == 'active'.
✗ Incorrect
We use 'sensor' as the variable name, map sensor.name to sensor.value, and filter by sensor.status.
