📖 Scenario: You are working with a SCADA system that monitors a factory's sensors. Some sensors send analog data like temperature and pressure, while others send digital data like on/off status of machines.To manage these sensors, you need to organize their data points clearly.
🎯 Goal: Create a simple program that stores sensor data points as analog or digital, then filters and shows only the analog data points.
📋 What You'll Learn
Create a dictionary called data_points with sensor names as keys and their types ('analog' or 'digital') as values.
Create a variable called filter_type and set it to the string 'analog'.
Use a dictionary comprehension to create a new dictionary called filtered_points that only contains sensors of type 'analog'.
Print the filtered_points dictionary.
💡 Why This Matters
🌍 Real World
SCADA systems monitor many sensors that send different types of data. Organizing and filtering these data points helps operators focus on important information quickly.
💼 Career
Understanding how to manage and filter sensor data is key for roles in industrial automation, system monitoring, and DevOps for manufacturing environments.
Progress0 / 4 steps
1
Create the data points dictionary
Create a dictionary called data_points with these exact entries: 'TempSensor1': 'analog', 'PressureSensor1': 'analog', 'MotorSwitch1': 'digital', 'ValveSwitch1': 'digital'.
SCADA systems
Hint
Use curly braces {} to create a dictionary. Each entry has a sensor name as a string key and its type as a string value.
2
Add the filter type variable
Create a variable called filter_type and set it to the string 'analog'.
SCADA systems
Hint
Just assign the string 'analog' to the variable filter_type.
3
Filter the analog data points
Use a dictionary comprehension to create a new dictionary called filtered_points that contains only the entries from data_points where the value equals filter_type. Use sensor and point_type as the loop variables.
SCADA systems
Hint
Use {sensor: point_type for sensor, point_type in data_points.items() if point_type == filter_type} to filter.
4
Display the filtered analog data points
Write a print statement to display the filtered_points dictionary.
SCADA systems
Hint
Use print(filtered_points) to show the filtered dictionary.
Practice
(1/5)
1. Which of the following best describes an analog data point in a SCADA system?
easy
A. It stores only true or false values.
B. It only shows ON or OFF states.
C. It is used to control digital switches.
D. It represents a continuous range of values like temperature or pressure.
Solution
Step 1: Understand analog data points
Analog points represent continuous values that can vary smoothly, such as temperature or pressure.
Step 2: Compare with digital points
Digital points only represent two states like ON/OFF or true/false, which is different from analog points.
Final Answer:
It represents a continuous range of values like temperature or pressure. -> Option D
Quick Check:
Analog = continuous values [OK]
Hint: Analog means continuous values, not just ON/OFF [OK]
Common Mistakes:
Confusing analog with digital points
Thinking analog points only have ON/OFF states
Assuming analog points store true/false values
2. Which of the following is the correct way to represent a digital data point in SCADA?
easy
A. A value that can be any number between 0 and 100.
B. A value that is either 0 or 1.
C. A value that changes smoothly over time.
D. A value that stores temperature readings.
Solution
Step 1: Identify digital data point characteristics
Digital points represent binary states, commonly 0 or 1, indicating OFF or ON.
Step 2: Eliminate incorrect options
Options A, B, and D describe analog or continuous values, not digital points.
Final Answer:
A value that is either 0 or 1. -> Option B
Quick Check:
Digital = 0 or 1 [OK]
Hint: Digital points are binary: 0 or 1 only [OK]
Common Mistakes:
Choosing continuous values for digital points
Confusing temperature readings as digital
Thinking digital points can have many values
3. Given the following SCADA data points: temperature = 72.5 # analog pump_status = 1 # digital What does pump_status = 1 indicate?
medium
A. The pump is ON.
B. The pump is OFF.
C. The temperature is high.
D. The pump is malfunctioning.
Solution
Step 1: Understand digital point meaning
Digital points use 1 to indicate ON and 0 to indicate OFF.
Step 2: Interpret the given value
Since pump_status is 1, it means the pump is ON.
Final Answer:
The pump is ON. -> Option A
Quick Check:
Digital 1 = ON [OK]
Hint: Digital 1 means ON, 0 means OFF [OK]
Common Mistakes:
Assuming 1 means OFF
Confusing analog temperature with pump status
Thinking 1 means malfunction
4. A SCADA system shows a digital data point with value 2. What is the likely issue?
medium
A. The digital point is correctly showing ON state.
B. The analog point is malfunctioning.
C. The digital point value is invalid; digital points only accept 0 or 1.
D. The system is showing temperature in digital format.
Solution
Step 1: Recall valid digital point values
Digital points accept only 0 or 1 to represent OFF or ON states.
Step 2: Analyze the given value
A value of 2 is outside the valid range, indicating an error or misconfiguration.
Final Answer:
The digital point value is invalid; digital points only accept 0 or 1. -> Option C
Quick Check:
Digital values must be 0 or 1 [OK]
Hint: Digital points only accept 0 or 1, no other values [OK]
Common Mistakes:
Accepting values other than 0 or 1 for digital points
Confusing digital and analog data types
Assuming 2 means ON state
5. You want to monitor a valve's position in a SCADA system. The valve can be fully open, partially open, or closed. Which data point type should you use and why?
hard
A. Analog, because it can represent a range of positions.
B. Neither, because SCADA cannot monitor valve positions.
C. Digital, because partial positions are not important.
D. Digital, because it only needs ON or OFF states.
Solution
Step 1: Understand valve position requirements
The valve has multiple states: fully open, partially open, and closed, which is a range, not just ON/OFF.
Step 2: Choose appropriate data point type
Analog points can represent continuous or multiple values, making them suitable for partial positions.
Final Answer:
Analog, because it can represent a range of positions. -> Option A
Quick Check:
Multiple states = Analog [OK]
Hint: Use analog for multiple or partial states, digital for ON/OFF [OK]
Common Mistakes:
Choosing digital for multi-position valves
Ignoring partial states importance
Thinking SCADA cannot monitor valve positions
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.