0
0
SCADA systemsdevops~30 mins

Automatic vs manual mode switching in SCADA systems - Hands-On Comparison

Choose your learning style9 modes available
Automatic vs Manual Mode Switching in SCADA Systems
📖 Scenario: You are working with a SCADA (Supervisory Control and Data Acquisition) system that controls a water pump station. The system can operate in two modes: automatic mode, where the pump runs based on sensor readings, and manual mode, where an operator controls the pump directly.To ensure safety and flexibility, the system must switch between these modes correctly.
🎯 Goal: Build a simple program that stores the current mode of the pump station, allows switching between automatic and manual modes, and prints the current mode.
📋 What You'll Learn
Create a variable to store the current mode with the exact name current_mode.
Create a variable called allowed_modes that holds the list of modes: 'automatic' and 'manual'.
Write a function called switch_mode that takes a mode name and changes current_mode only if the mode is in allowed_modes.
Print the current mode using print.
💡 Why This Matters
🌍 Real World
SCADA systems control critical infrastructure like water pumps, power grids, and factories. Correct mode switching ensures safety and proper operation.
💼 Career
Understanding mode switching logic is essential for DevOps engineers working with industrial automation and monitoring systems.
Progress0 / 4 steps
1
Set the initial mode
Create a variable called current_mode and set it to the string 'manual'.
SCADA systems
Need a hint?

Use a simple assignment to set current_mode to 'manual'.

2
Define allowed modes
Create a list called allowed_modes containing the strings 'automatic' and 'manual'.
SCADA systems
Need a hint?

Use square brackets to create a list with the two mode strings.

3
Create the mode switching function
Write a function called switch_mode that takes a parameter mode. Inside the function, check if mode is in allowed_modes. If yes, update the global variable current_mode to mode. Use the global keyword to modify current_mode inside the function.
SCADA systems
Need a hint?

Remember to declare current_mode as global inside the function to modify it.

4
Switch mode and print the result
Call the function switch_mode with the argument 'automatic'. Then print the value of current_mode using print(current_mode).
SCADA systems
Need a hint?

Call switch_mode('automatic') and then print current_mode.