September 20, 2026

Drip Irrigation Zone Control Application Using a Siemens S7-1200 PLC with SCL Programming Language

A drip irrigation zone application divides an agricultural field or garden into multiple irrigation zones, allowing each zone to be watered independently based on crop requirements, soil moisture, and water availability.

Key functions:

  • Zone Control: Operates solenoid valves to control water flow to individual zones.

  • Automation: Uses a PLC or irrigation controller to schedule irrigation cycles.

  • Sensor Monitoring: Monitors soil moisture, water pressure, and flow rate.

  • Water Efficiency: Delivers water directly to plant roots, reducing water wastage.

  • Protection: Detects low pressure, leakage, or abnormal flow and generates alarms.

  • HMI/SCADA Monitoring: Displays zone status, irrigation time, and sensor readings.

Functional schematic overview for the PLC application.

I/O and Internal Tags

Area

Tag

Type

Default

Description

INPUT

AutoMode

Bool

 

 

INPUT

StartPB

Bool

 

 

INPUT

StopPB

Bool

 

 

INPUT

ResetPB

Bool

 

 

INPUT

EStopOK

Bool

 

 

INPUT

SensorIn

Bool

 

 

INPUT

SensorDone

Bool

 

 

INPUT

ActuatorHome

Bool

 

 

INPUT

ActuatorExtended

Bool

 

 

INPUT

Step1Time

Time

T#1s

 

INPUT

Step2Time

Time

T#3s

 

INPUT

Step3Time

Time

T#1s

 

INPUT

TimeoutTime

Time

T#20s

 

OUTPUT

ConveyorRun

Bool

 

 

OUTPUT

ClampOutput

Bool

 

 

OUTPUT

ProcessOutput

Bool

 

 

OUTPUT

DischargeOutput

Bool

 

 

OUTPUT

CycleActive

Bool

 

 

OUTPUT

CycleDonePulse

Bool

 

 

OUTPUT

Fault

Bool

 

 

OUTPUT

StepNo

Int;

 

0 idle, 10 wait/index, 20 clamp, 30 process, 40 discharge

VAR

AutoMode

Bool

 

 

VAR

StartPB

Bool

 

 

VAR

StopPB

Bool

 

 

VAR

ResetPB

Bool

 

 

VAR

EStopOK

Bool

 

 

VAR

SensorIn

Bool

 

 

VAR

SensorDone

Bool

 

 

VAR

ActuatorHome

Bool

 

 

VAR

ActuatorExtended

Bool

 

 

VAR

Step1Time

Time

T#1s

 

VAR

Step2Time

Time

T#3s

 

VAR

Step3Time

Time

T#1s

 

VAR

TimeoutTime

Time

T#20s

 

SCL Program

// Application 111: Drip Irrigation Zone

// Category: Agriculture

// PLC: Siemens S7-1200

// Language: SCL for TIA Portal

// Note: Training template. Validate all safety and machine behavior before commissioning.

 

FUNCTION_BLOCK "FB_111_DripIrrigationZone"

{ S7_Optimized_Access := 'TRUE' }

VERSION : 1.0

 

VAR_INPUT

    AutoMode : Bool;

    StartPB : Bool;

    StopPB : Bool;

    ResetPB : Bool;

    EStopOK : Bool;

    SensorIn : Bool;

    SensorDone : Bool;

    ActuatorHome : Bool;

    ActuatorExtended : Bool;

    Step1Time : Time := T#1s;

    Step2Time : Time := T#3s;

    Step3Time : Time := T#1s;

    TimeoutTime : Time := T#20s;

END_VAR

 

VAR_OUTPUT

    ConveyorRun : Bool;

    ClampOutput : Bool;

    ProcessOutput : Bool;

    DischargeOutput : Bool;

    CycleActive : Bool;

    CycleDonePulse : Bool;

    Fault : Bool;

    StepNo : Int; // 0 idle, 10 wait/index, 20 clamp, 30 process, 40 discharge

END_VAR

 

VAR

    RunLatch : Bool;

    Step1Timer : TON;

    Step2Timer : TON;

    Step3Timer : TON;

    TimeoutTimer : TON;

END_VAR

 

BEGIN

    CycleDonePulse := FALSE;

 

    IF ResetPB AND EStopOK THEN

        Fault := FALSE;

        StepNo := 0;

    END_IF;

 

    IF StopPB OR NOT EStopOK OR Fault OR NOT AutoMode THEN

        RunLatch := FALSE;

        StepNo := 0;

    ELSIF StartPB AND AutoMode THEN

        RunLatch := TRUE;

    END_IF;

 

    IF RunLatch AND (StepNo = 0) THEN

        StepNo := 10;

    END_IF;

 

    Step1Timer(IN := StepNo = 20, PT := Step1Time);

    Step2Timer(IN := StepNo = 30, PT := Step2Time);

    Step3Timer(IN := StepNo = 40, PT := Step3Time);

    TimeoutTimer(IN := RunLatch AND (StepNo <> 0), PT := TimeoutTime);

 

    CASE StepNo OF

        10:

            IF SensorIn AND ActuatorHome THEN

                StepNo := 20;

            END_IF;

        20:

            IF Step1Timer.Q OR ActuatorExtended THEN

                StepNo := 30;

            END_IF;

        30:

            IF SensorDone OR Step2Timer.Q THEN

                StepNo := 40;

            END_IF;

        40:

            IF Step3Timer.Q THEN

                CycleDonePulse := TRUE;

                StepNo := 10;

            END_IF;

    END_CASE;

 

    IF TimeoutTimer.Q THEN

        Fault := TRUE;

        RunLatch := FALSE;

        StepNo := 0;

    END_IF;

 

    ConveyorRun := RunLatch AND ((StepNo = 10) OR (StepNo = 40));

    ClampOutput := RunLatch AND ((StepNo = 20) OR (StepNo = 30));

    ProcessOutput := RunLatch AND (StepNo = 30);

    DischargeOutput := RunLatch AND (StepNo = 40);

    CycleActive := RunLatch AND (StepNo <> 0);

END_FUNCTION_BLOCK

Commissioning reminder: validate all I/O mapping, permissive behavior, feedback wiring, emergency-stop circuits, and local safety requirements before running real equipment.

Commissioning Checklist

·        Map every PLC tag to the correct physical input, output, HMI tag, or memory address.

·        Compile in TIA Portal and adjust tag names, timers, and setpoints for the real machine.

·        Test normal sequence, stop, reset, feedback failure, timeout, and alarm conditions in simulation first.

·        Use certified safety hardware or fail-safe logic for emergency stops, guards, and hazardous motion.