๐ŸŸข Technician Track
Tutorial T0 of 10
๐ŸŸข TECHNICIAN TRACK โ€ข FOUNDATION

Python Readiness for PLC Engineers

The Only Python You Need to Safely Use Agentic AI

โœ… CORE MISSION OF THIS TUTORIAL

By the end of this tutorial, the reader will be able to:

  • โœ… Run Python scripts safely on their own machine
  • โœ… Understand the basic Python syntax used in Technician Track tutorials
  • โœ… Modify simple variables, conditions, and dictionaries
  • โœ… Use for-loops and while-loops with industrial-style examples
  • โœ… Install required Python packages
  • โœ… Confidently run all Technician Track experiments without fear

This tutorial establishes the minimum Python foundation required for safe Technician use of AI systems.

โš ๏ธ

โš ๏ธ SAFETY BOUNDARY REMINDER

This tutorial uses simulation only.

It must never be connected to:

  • Live PLCs
  • Production deployment pipelines
  • Safety-rated controllers
  • Motion or power systems

> All outputs are advisory-only and always require explicit human approval before any real-world action.

๐ŸŒ VENDOR-AGNOSTIC ENGINEERING NOTE

This tutorial uses:

  • โ–ธ Standard Python 3.x
  • โ–ธ Local execution only
  • โ–ธ No vendor SDKs
  • โ–ธ No PLC communication libraries
  • โ–ธ No automation system access

Safe to use on Windows, macOS, and Linux.

Estimated Time
45 min
Estimated Cost
$0.00
Difficulty
Beginner

1๏ธโƒฃ CONCEPT OVERVIEW โ€” WHY PYTHON IS USED IN THE TECHNICIAN TRACK

Python is used because it is:

  • โ–ธ Simple to read
  • โ–ธ Safe to sandbox
  • โ–ธ Cross-platform
  • โ–ธ Widely supported
  • โ–ธ The standard language for AI tooling

In this track, Python is used only as a simulator and AI interface, never as a control system.

Python = your safe AI workbench
PLC = your real machine controller

They must never be confused.

2๏ธโƒฃ REFERENCE ARCHITECTURE โ€” HOW YOU WILL USE PYTHON

You โ†’ Run Python Script โ†’ AI Gives Advisory Output โ†’ You Decide

Boundaries

  • โ–ธ Python does NOT control machines
  • โ–ธ Python does NOT write PLC memory
  • โ–ธ Python does NOT touch safety systems
  • โ–ธ You remain the operator

3๏ธโƒฃ CLEAN EDUCATIONAL EXAMPLE โ€” YOUR FIRST PYTHON PROGRAM

Create a file called hello.py

Python
# hello.py
print("Hello from Python. This is my AI workbench.")

Run it from your terminal:

BASH
# Run your first Python program
python hello.py

Expected Output:

Hello from Python. This is my AI workbench.

4๏ธโƒฃ PRACTICAL EXPERIMENTS

๐Ÿงช Experiment 1: Variables, Conditions, and Motor State

Objective

Understand how Python simulates simple industrial logic using variables and conditions.

Python Code

Python
motor_running = False
start_button = True
fault = False

if fault:
    motor_running = False
elif start_button:
    motor_running = True

print("Motor running:", motor_running)

Expected Output

Motor running: True

Interpretation

  • โ–ธ โœ… Local only
  • โ–ธ โœ… No hardware
  • โ–ธ โœ… No side effects
  • โ–ธ Cost: $0.00 | Runtime: <1 second

๐Ÿงช Experiment 2: Lists, for-Loops, and while-Loops with Alarm Scanning

Objective

Learn how Python processes collections of industrial data and how loops simulate repetitive machine checks.

Python Code

Python
# Part A: Using a List and a for-Loop (Alarm Log Scan)
alarm_log = [
    {"id": 101, "message": "Motor Overcurrent"},
    {"id": 102, "message": "Emergency Stop"},
    {"id": 103, "message": "Drive Ready"}
]

print("Scanning alarm log:")
for alarm in alarm_log:
    print(alarm["id"], "-", alarm["message"])

print()

# Part B: Using a while-Loop (Simulated Machine Polling)
scan_count = 0
max_scans = 3

while scan_count < max_scans:
    print("Polling machine status... Scan:", scan_count + 1)
    scan_count += 1

Expected Output

Scanning alarm log:
101 - Motor Overcurrent
102 - Emergency Stop
103 - Drive Ready

Polling machine status... Scan: 1
Polling machine status... Scan: 2
Polling machine status... Scan: 3

Interpretation

  • โ–ธ โœ… Read-only data
  • โ–ธ โœ… No writes
  • โ–ธ โœ… No automation risk
  • โ–ธ Cost: $0.00 | Runtime: <1 second

5๏ธโƒฃ INSTALLING PACKAGES (REQUIRED SKILL)

All future tutorials will require installing packages.

Example:

BASH
# Install OpenAI package
pip install openai

To verify:

BASH
# List all installed packages
pip list

๐Ÿ”’ EXPLICIT OPERATIONAL PROHIBITIONS

  • โŒ Using Python to control PLCs
  • โŒ Using Python to bypass safety
  • โŒ Using Python for live machine actuation
  • โŒ Connecting Python to real industrial networks

โœ… KEY TAKEAWAYS

  • โœ… Python is your safe AI sandbox
  • โœ… You only need: Variables, Conditions, Lists & dictionaries, for-loops and while-loops
  • โœ… All Technician Track tutorials stay inside this boundary
  • โœ… You never need to be a "software engineer" to succeed here

๐Ÿ”œ NEXT TUTORIAL

T1 โ€” Agentic AI vs Traditional Automation

Understand the fundamental difference between agentic AI systems and traditional rule-based automation.

๐Ÿงญ ENGINEERING POSTURE

This tutorial enforced:

  • โ–ธ Simulation over real actuation
  • โ–ธ Education over production control
  • โ–ธ Human authority over automation
  • โ–ธ Safety over convenience

โœ… END OF PYTHON READINESS TUTORIAL