Gas station control (Mini-Sim)
Couldn't load pickup availability
This SCL function block FB_Tankanlage controls a simple tank system with safety monitoring, quantity recording, time limit, and acknowledgment via the HMI. Runnable in the Siemens TIA Portal, it ensures safe and transparent refueling processes.
Note: All modules are designed exclusively as a learning and optimization basis and are not approved for live operation. System modules, in particular, must be finally tested and commissioned by qualified personnel before productive use.
How it works
-
Cycle start: Reset markers/outputs, HMI “READY”
-
Fault/full signal/gun not pulled → valve off, timer off, alarm on, HMI "STOPPED", Finished=TRUE
-
Start_Fueling + no stop → Open valve, fueling process in progress
-
1-second timer ticks → Increment LiterPerSec, PricePerLiter, FuelTimeCounter, Sum up Liters & Price
-
Tank time counter ≥ MaxTime → Valve off, Finished=TRUE, HMI "TIME LIMIT"
-
Reset_Tank → reset all counters, alarm, finished, HMI “READY”
Technical details
• Inputs: Fault, Full Message, Gun Pulled, Start_Fuel, Reset_Tank
• Outputs: Valve_ON, Alarm, StatusText_HMI
• Internal variables: Liter, Price, Tank Time Counter, Finished
• TON timer (PT=T#1s) for second cycle
• LiterPerSec & PricePerLiter define flow rate/tariff
• INT_TO_STRING/REAL_TO_STRING for HMI strings
Possible applications
• Fuel and liquid filling systems
• Mobile refueling units
• Industrial processes with volume and time control
• Training on PLC process controls
compatibility
Siemens S7-1200 & S7-1500; TIA Portal V13 and higher (V16+ recommended for HMI & PLCSIM)
Scope of delivery
.scl file with declaration of all inputs/outputs, timers, variables, state transitions, and comment blocks; download link available immediately after purchase
Support
Flow rate adjustment, additional safety features, HMI layout integration or data logging/reporting available upon request via shop message or email.