Skip to content

Raafat5566/discrete-event-control-case-study

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discrete Event Control Case Study (TIA Portal)

This repository contains a case study implementation of a Discrete Event Control Architecture for a Siemens SIMATIC PLC workflow using TIA Portal and SCL-based function blocks.

The project combines:

  • Discrete event operating logic (modes, interlocks, force states, alarms)
  • Analog and digital module templates
  • Process behavior simulation blocks for test and validation
  • Supporting technical reports and plant description material

1. Project Scope

The case study focuses on building a modular control structure that is suitable for process units with:

  • Manual/Auto operation
  • Interlocks and permissives
  • Force and safety-oriented override behavior
  • Alarm handling and feedback supervision
  • Simulation-first validation before deployment

The overall control philosophy aligns with operating mode/state-driven process control concepts used in industrial automation.


2. Repository Structure

AO_Project Files/
  AO_Project Files/
    DO_Data.udt
    DO_Module.scl
    Do_Sim.scl
    Motor_AO.scl
    Pump Simulation.scl
    Pump_Data.udt
assets/
  images/
docs/
  reports/
archives/
Material/
  Plant Description/
    Festo Plant Description Translated/
PLC SIEMENS/

Additional technical reports and diagrams are available at the workspace root and in Material/.


3. Main Control Blocks

3.1 DO_Module.scl

Digital output module with:

  • Enable gating
  • Interlock handling
  • Manual/Auto command arbitration
  • Force-off priority behavior
  • Feedback supervision timers and mismatch detection
  • Alarm reporting through DO_Data

3.2 Motor_AO.scl

Analog output module for motor/pump-style control with:

  • Enable/Interlock/Manual-Auto operating logic
  • Selector-based interlock handling
  • Range validation of operator and interlock values
  • Force behavior and alarm handling
  • Not-following supervision against feedback
  • Alarm reporting through Pump_Data

3.3 Pump Simulation.scl

First-order lag process model:

  • Simulates pump output response to command value
  • Uses configurable Tau, Gain, and Ts
  • Includes output limiting and numerical protection

3.4 Do_Sim.scl

Discrete-time thermal-like simulation for digital command response:

  • Real elapsed-time-based update
  • Temperature-like state response between min/max limits
  • Feedback bit generation

3.5 UDTs and Alarm DB

  • DO_Data.udt: alarm fields for digital module
  • Pump_Data.udt: warning/alarm fields for analog module
  • Alarms.db: centralized alarm storage structure

4. Control Priorities (Design Intent)

The implemented blocks follow a clear priority structure:

  1. Disable and safety states dominate normal control behavior.
  2. Force conditions override normal commands.
  3. Interlocks take precedence over Manual/Auto requests.
  4. Manual/Auto command logic applies only when higher-priority conditions are healthy.
  5. Supervision and alarm logic monitor consistency between command and feedback.

This pattern improves maintainability and reduces ambiguity during commissioning and troubleshooting.


5. How to Use in TIA Portal

  1. Create/open your SIMATIC project in TIA Portal.
  2. Import the SCL sources from AO_Project Files/AO_Project Files/.
  3. Import/create UDTs (DO_Data, Pump_Data) before compiling FBs.
  4. Create instance DBs for DO_Module, Motor_AO, and simulation FBs.
  5. Map physical or simulated I/O to FB inputs/outputs.
  6. Download to PLC or run PLCSIM to validate mode changes, interlocks, and alarms.

Recommended validation sequence:

  1. Verify Enable/Disable behavior.
  2. Verify Force and Interlock priority paths.
  3. Verify Manual/Auto transitions.
  4. Verify feedback mismatch timing and alarm reset behavior.

6. Visuals and Diagrams

6.1 AO and DO Logic Views

AO Logic

DO Logic

AO Module Detail

DO Module Detail

6.2 Interlock and Feedback

Interlock Logic

Feedback Supervision

6.3 Simulation Views

Simulation Overview

Simulation Diagram

6.4 Reference State Graph

State Graph of Operating Modes


7. Reference Documents

  • Material/Control of Discrete Event Systems-Case Study Report.pdf
  • Material/Development and Implementation of a Discrete Event Control Architecture for Simatic S7.pdf
  • docs/reports/Control Theory.pdf
  • docs/reports/Plant Components and Description.pdf

These reports provide the theoretical background, plant-level context, and implementation rationale.


8. Notes

  • File and folder naming currently includes spaces in some locations (for example, DO_Module .jpeg).
  • If you plan to automate documentation pipelines, consider normalizing names to avoid path edge cases.
  • This README is designed to be a practical entry point for engineers reviewing or extending the case study.

About

TIA Portal Discrete Event Control case study with SCL modules, simulations, and documentation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors