0
0
SCADA systemsdevops~30 mins

Trend charts and historical data in SCADA systems - Mini Project: Build & Apply

Choose your learning style9 modes available
Trend Charts and Historical Data in SCADA Systems
📖 Scenario: You work as a SCADA system operator. You need to collect sensor readings over time and display them as trend charts. This helps you see how values change and spot problems early.
🎯 Goal: Build a simple program that stores sensor readings in a dictionary, sets a time window for data collection, filters readings within that window, and prints the filtered data for trend charting.
📋 What You'll Learn
Create a dictionary with sensor names as keys and lists of (timestamp, value) tuples as values.
Add a variable to set the time window (in minutes) for filtering recent data.
Write code to filter sensor readings to only include those within the time window from the latest timestamp.
Print the filtered sensor data showing timestamps and values.
💡 Why This Matters
🌍 Real World
SCADA operators monitor sensor data trends to detect equipment issues early and maintain safe operations.
💼 Career
Understanding how to manage and filter historical sensor data is key for roles in industrial automation and control systems.
Progress0 / 4 steps
1
Create sensor data dictionary
Create a dictionary called sensor_data with these exact entries: 'Temperature' with readings [(1, 22.5), (2, 23.0), (3, 23.5)], and 'Pressure' with readings [(1, 101.3), (2, 101.5), (3, 101.7)]. Each reading is a tuple of (timestamp, value).
SCADA systems
Need a hint?

Use a dictionary with keys 'Temperature' and 'Pressure'. Each key has a list of tuples with timestamps and values.

2
Set time window for filtering
Add a variable called time_window and set it to 2 to represent the last 2 time units for filtering sensor data.
SCADA systems
Need a hint?

Just create a variable named time_window and assign it the value 2.

3
Filter sensor data by time window
Create a new dictionary called filtered_data. For each sensor in sensor_data, include only readings where the timestamp is greater than the latest timestamp minus time_window. Use for sensor, readings in sensor_data.items() to loop.
SCADA systems
Need a hint?

Use a dictionary comprehension or a loop to filter readings by timestamp compared to latest_time minus time_window.

4
Print filtered sensor data
Write a print(filtered_data) statement to display the filtered sensor readings.
SCADA systems
Need a hint?

Use print(filtered_data) to show the filtered readings.