0
0
SCADA systemsdevops~10 mins

Polling vs report-by-exception in SCADA systems - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to show how polling works by regularly checking a sensor value.

SCADA systems
while True:
    sensor_value = read_sensor()
    if sensor_value [1] threshold:
        alert_operator()
    sleep(5)
Drag options to blanks, or click blank then click option'
A>
B!=
C<=
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' will only alert if value equals threshold exactly.
2fill in blank
medium

Complete the code to implement report-by-exception by sending data only when it changes.

SCADA systems
previous_value = None
while True:
    current_value = read_sensor()
    if current_value [1] previous_value:
        send_report(current_value)
        previous_value = current_value
    sleep(5)
Drag options to blanks, or click blank then click option'
A<
B!=
C==
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' will send report only if values are the same, which is wrong.
3fill in blank
hard

Fix the error in this polling loop that causes it to miss alerts.

SCADA systems
while True:
    value = read_sensor()
    if value [1] threshold:
        alert_operator()
    sleep(5)
Drag options to blanks, or click blank then click option'
A>=
B>
C<
D==
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' misses the case when value equals threshold.
4fill in blank
hard

Fill both blanks to create a report-by-exception dictionary with sensor names and values only if value changed.

SCADA systems
reports = {sensor: [1] for sensor, value in sensors.items() if value [2] last_values.get(sensor)}
Drag options to blanks, or click blank then click option'
Avalue
B==
C!=
Dsensor
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' will include unchanged sensors.
5fill in blank
hard

Fill all three blanks to build a polling loop that reads sensors, updates last values, and alerts if any value exceeds threshold.

SCADA systems
last_values = {}
while True:
    readings = {sensor: read_sensor(sensor) for sensor in sensors}
    for sensor, value in readings.items():
        if value [1] threshold:
            alert_operator(sensor, value)
        last_values[[2]] = [3]
    sleep(5)
Drag options to blanks, or click blank then click option'
A>
Bsensor
Cvalue
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' will alert for values below threshold, which is incorrect.