HMI & RECIPES
TwinCAT HMI exposes recipes, controls and state
The visualization provides recipe selection, start/stop controls, values, counters and maintenance information.
PLC STATE MACHINE
The process is represented as explicit PLC states
A CASE-based Structured Text sequence makes production phases, transitions and application-level stop conditions inspectable.
SIMULATED PROCESS
Recipe targets drive simulated process behaviour
Recipe targets drive software values for tank level, temperature, mixing and bottling.
ADS MONITORING
ADS exposes live values to Python
Python reads bottle count, temperature and status once per second for live terminal monitoring.
STRUCTURED TEXT
Making the process sequence visible as PLC states
STATE_FILLING:
GVL_Process.sStatusMessage := 'FILLING TANK...';
GVL_Process.bInletValve := TRUE;
GVL_Process.fCurrentLevel := GVL_Process.fCurrentLevel + fFillRate;
IF GVL_Process.fCurrentLevel >= GVL_Process.stCurrentRecipe.fTargetFill_ml THEN
GVL_Process.fCurrentLevel := GVL_Process.stCurrentRecipe.fTargetFill_ml;
GVL_Process.bInletValve := FALSE;
eState := STATE_HEATING;
END_IFMY CONTRIBUTION
Connecting process states, operator controls and monitoring
I implemented the Structured Text state machine for filling, heating, mixing and bottling, then connected recipe data and HMI controls to that sequence. I also built the ADS/Python monitor to read process values from the PLC runtime.
RECIPE & HMI
Changing process targets without rewriting the sequence
Two recipes supply fill, temperature and mixing-duration targets to the same state machine. Recipe data sets the conditions for advancing through the process. The HMI combines recipe selection and start/stop controls with process values, actuator states and counters.
MAINTENANCE CONCEPT
Integrating a cycle-count maintenance state
Inlet-valve rising edges increment a cycle counter. At a fixed threshold, the sequence enters a maintenance state and switches off the simulated actuators. Clearing the maintenance alarm from the HMI resets the counter and returns the sequence to idle.
PYTHON MONITORING
Observing PLC values through a separate ADS client
A Python client reads bottle count, temperature and status from the TwinCAT runtime over ADS once per second. Terminal output makes those live values visible alongside the HMI.
RESULT
One process sequence across recipes, HMI and monitoring
The application brings recipe-dependent transitions, operator controls and maintenance handling into one process sequence, with its values visible in the HMI and through the ADS client.