Practical Python manual for industrial automation reporting, SQL historian data, Excel/PDF generation, email alerts, REST API and scheduled plant reports.
A safe, reproducible path from local file logging to industrial protocols, SQL, reporting, APIs, testing and handover. Example addresses use TEST-NET ranges and must be replaced only with trainer-approved lab endpoints.
Lab 01 - Create a Reproducible Python Environment
Objective: Create an isolated project and record dependency versions.
A. Step-by-Step Procedure
Install a supported Python 3 release in the lab environment.
Create and activate a virtual environment.
Install only the protocol/data packages needed by later labs.
Export a requirements file and create a configuration template without passwords.
A known input dataset produces the expected count/min/max for each shift.
Save the project/code and record the environment version.
Repeat the test from a known initial state.
Capture the required runtime or output evidence.
C. If the Result Is Wrong
Check
Action
Environment and connection
Confirm version, driver, address, permissions and communication state.
Input, parameter or code
Compare the configured value with the lab sheet and official documentation.
Output/result
Trace the value step by step, correct the first deviation and retest safely.
D. Student Evidence Record
File
Project/code filename and revision.
Values
Inputs, settings and observed outputs.
Fault test
Fault introduced, symptom and correction.
Conclusion
Pass criteria and learner observation.
REAL LAB SCREENSHOT / OUTPUT EVIDENCE
Attach a verified capture from the completed lab.
Expected Result and Runtime Behavior
The raw log remains unchanged and a separate summary is produced.
Lab 09 - Expose a Read-Only FastAPI Endpoint
Objective: Serve a validated status object for an internal lab dashboard.
A. Step-by-Step Procedure
Create a read-only response model.
Return a controlled sample or validated collector state.
Run only on the training network.
Test success and invalid-route responses.
from fastapi import FastAPI
app = FastAPI(title="Softwell Lab API")
@app.get("/status")
def status():
return {"line":"Lab-01","state":"READY","quality":"GOOD"}
# Run in lab: uvicorn app:app --host 127.0.0.1 --port 8000
B. Verification Checklist
GET /status returns HTTP 200 and the documented JSON fields.
Save the project/code and record the environment version.
Repeat the test from a known initial state.
Capture the required runtime or output evidence.
C. If the Result Is Wrong
Check
Action
Environment and connection
Confirm version, driver, address, permissions and communication state.
Input, parameter or code
Compare the configured value with the lab sheet and official documentation.
Output/result
Trace the value step by step, correct the first deviation and retest safely.
D. Student Evidence Record
File
Project/code filename and revision.
Values
Inputs, settings and observed outputs.
Fault test
Fault introduced, symptom and correction.
Conclusion
Pass criteria and learner observation.
REAL LAB SCREENSHOT / OUTPUT EVIDENCE
Attach a verified capture from the completed lab.
Expected Result and Runtime Behavior
The lab dashboard can read a stable, read-only status endpoint.
Lab 10 - Test, Package and Handover the Collector
Objective: Create repeatable checks and an operator handover record.
A. Step-by-Step Procedure
Write tests for scaling, validation and error paths.
Run tests before packaging.
Document configuration, credentials process and service restart.
Archive code, requirements, test result and sample output.
def scale(raw, low=0.0, high=100.0):
if not 0 <= raw <= 27648:
raise ValueError("raw out of range")
return low + (raw / 27648.0) * (high - low)
def test_scale_midpoint():
assert round(scale(13824), 1) == 50.0
B. Verification Checklist
pytest passes the normal case and a separate test confirms invalid input raises ValueError.
Save the project/code and record the environment version.
Repeat the test from a known initial state.
Capture the required runtime or output evidence.
C. If the Result Is Wrong
Check
Action
Environment and connection
Confirm version, driver, address, permissions and communication state.
Input, parameter or code
Compare the configured value with the lab sheet and official documentation.
Output/result
Trace the value step by step, correct the first deviation and retest safely.
D. Student Evidence Record
File
Project/code filename and revision.
Values
Inputs, settings and observed outputs.
Fault test
Fault introduced, symptom and correction.
Conclusion
Pass criteria and learner observation.
REAL LAB SCREENSHOT / OUTPUT EVIDENCE
Attach a verified capture from the completed lab.
Expected Result and Runtime Behavior
The collector has code, dependency, test, configuration and handover evidence.
Before You Start: Prerequisites, Tested Version, Safety and Evidence
This manual is a practical training workbook, not a substitute for the installed product manual or the site's approved engineering procedure. Record the exact software, firmware, license and hardware before following a step because menus and supported functions can vary by release.
Tested-version planning scope: Confirm Python 3.11 or later in an isolated virtual environment with pinned, trainer-approved package versions. Enter the exact lab-tested software, firmware and hardware in the record below before course delivery; never assume cross-version compatibility.
Environment record
Software build, firmware, device catalog, driver, communication interface and license status.
Safe lab boundary
Use an isolated training system. Follow electrical, mechanical, process and cybersecurity controls before energizing or downloading.
Evidence pack
Keep the source project, parameter/code export, screenshot/trend, fault test, correction and final pass result.
Technical review
Last reviewed by Softwell Automation Technical Training Team on 17 July 2026.
Field
Learner record
Verification
Software / firmware
________________
Matches the training device and official compatibility information
Project / backup
________________
Saved before and after the practical
Pass evidence
________________
Runtime value, trend, alarm, diagnostic or report attached
Fault tested
________________
Symptom, cause, check and corrective action documented
Practice, Viva and Extension Challenge
Practice
Change one approved input or parameter, predict the result, execute the test and explain any difference.
Viva
Explain the data flow, safety boundary, first diagnostic check and recovery method without opening the answer.
Extension challenge
Add one useful function while preserving the original pass criteria, alarm behavior and rollback path.
Graded mini-project
Combine at least three practicals, submit a versioned project and evidence pack, and demonstrate repeatable recovery.
Instructional workflow diagram: complete configuration, measurable verification, controlled diagnosis and recovery evidence in sequence.Python — official documentation
Content status: Substantively reviewed and expanded 17 July 2026. Verify release-specific details against the linked official documentation.
Enquire Now
For syllabus, manual PDF, corporate batch or online training details, contact Softwell Automation.
Course Contents / Curriculum
The curriculum follows a practical sequence from fundamentals to project integration.
Level 01Basic PLC, wiring, addressing and ladder logic.
Level 02Advanced PLC, networking, SCADA and diagnostics.
Level 03OPC UA, SQL, Python, reports and IT/OT integration.
Verified learning pathway
Practise This Manual with Guidance
Use the manual with trainer-led practicals, software exercises and troubleshooting support.