Jump to content

Irrigation Program Looping


Recommended Posts

Posted

Hi, hope someone is able to help me with this one. I've created a program to irrigate my lawn based on time of day and climate module, for some reason the program starts and only runs the first 4 lines of "Then" command then continues to loop (sprinklers solenoid 1 stays on until I manually shut it down). Looking at the program summary it show that the program is restarting itself every hour (wait time?).

Irrigation Auto Cycle - [ID 001B][Parent 0034]

If
        Time is Sunrise -  1 hour 
    And Module 'Climate' Irrigation Requirement > 12 mm
    And Module 'Climate' Temperature > 5 °C
    And Module 'Climate' 24h Rain < 10 mm
    And Module 'Climate' Rain Tomorrow < 10 mm
 
Then
        Set Elk Output '$PLR SOL 1' On
        Wait  5 seconds
        Set 'Irrigation Pump' On
        Wait  1 hour and 1 minute 
        Set Elk Output '$PLR SOL 2' On
        Set Elk Output '$PLR SOL 1' Off
        Wait  1 hour and 1 minute 
        Set Elk Output '$PLR SOL 3' On
        Set Elk Output '$PLR SOL 2' Off
        Wait  1 hour and 1 minute 
        Set 'Irrigation Pump' Off
        Wait  5 seconds
        Set Elk Output '$PLR SOL 3' Off
        Irrigation - Cycle Complete
 
Else
   - No Actions - (To add one, press 'Action')
 


 

Posted
1 hour ago, RGKS said:

Hi, hope someone is able to help me with this one. I've created a program to irrigate my lawn based on time of day and climate module, for some reason the program starts and only runs the first 4 lines of "Then" command then continues to loop (sprinklers solenoid 1 stays on until I manually shut it down). Looking at the program summary it show that the program is restarting itself every hour (wait time?).


Irrigation Auto Cycle - [ID 001B][Parent 0034]

If
        Time is Sunrise -  1 hour 
    And Module 'Climate' Irrigation Requirement > 12 mm
    And Module 'Climate' Temperature > 5 °C
    And Module 'Climate' 24h Rain < 10 mm
    And Module 'Climate' Rain Tomorrow < 10 mm
 
Then
        Set Elk Output '$PLR SOL 1' On
        Wait  5 seconds
        Set 'Irrigation Pump' On
        Wait  1 hour and 1 minute 
        Set Elk Output '$PLR SOL 2' On
        Set Elk Output '$PLR SOL 1' Off
        Wait  1 hour and 1 minute 
        Set Elk Output '$PLR SOL 3' On
        Set Elk Output '$PLR SOL 2' Off
        Wait  1 hour and 1 minute 
        Set 'Irrigation Pump' Off
        Wait  5 seconds
        Set Elk Output '$PLR SOL 3' Off
        Irrigation - Cycle Complete
 
Else
   - No Actions - (To add one, press 'Action')
 


 

Create another program called "Irrigation Auto Initiate"
Move all your triggers over to the new program and delete from original program IF section
….This can be done easier with a program copy and then edit each for undesired sections..
Enter Then line, run Program (If)  Irrigation Auto Cycle  (Only line left)

In the Then section of the old program "Irrigation Auto Cycle", add these lines...
The first line in the program. Disable Program "Irrigation Auto Initiate"
The last line in the program Enable Program "Irrigation Auto Initiate"

Your initiate trigger lines have changing parameters and it causes If re-evaluation and restarts Then or Else, interrupting your cycle process. The above technique will isolate the Then from the If section triggers after it has been started.


I prfer a better way, to update a STATE variable from 0 to 1 (False to True). Then make the cycle program dependant on the STATE variable = 1. Now you have control of the cycle from other programs and it keeps it simpler.
If you do this be sure to add code to the Else section of the cycle to clean up whatever is going on at the time and reset the STATE variable back to 0.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...