OSC and DoW still confusing

plasmacon

New member
I have been through the manual, and I can get some things to work, but I am having trouble understanding why things do what they do. The lack of understanding leads me to my latest issue.

I have messed with the statements and I wish there was a simulator to try this stuff on... I need to understand the rules of these statements to learn how to use them. Waiting 24 hours to see how things work is a pain.

Basically what I would like to accomplish is this. I would like an automatic feed mode created without using FeedA,B,C,or D.

#1. I would like my return pump (RetPump) to kick off Mondays and Fridays, from 00:00 to 02:00.

#2. I would like two separate circulation pumps (PumpA & PumpB), non-controllable, to oscillate one hour each, every night. The two circulation pumps run constantly, except starting at 22:00 through 06:00, they oscillate. From 00:00 to 02:00 they are back on, Mondays and Fridays if possible. Then both CirPumps off from 02:00 to 03:59. Then one more oscillation each until 05:59.

22:00 to 22:59
PumpA - ON Everyday
PumpB - OFF Everyday

23:00 to 23:59
PumpA - OFF Everyday
PumpB - ON Everyday

00:00 to 01:59
RetPump - OFF Mondays and Fridays ON S-TWT-S
PumpA - ON Mondays and Fridays OS C S-TWT-S
PumpB- ON Mondays and Fridays OSC S-TWT-S

02:00 to 03:59
PumpA - OFF Everyday
PumpB - OFF Everyday

04:00 to 04:59
PumpA - ON Everyday
PumpB - OFF Everyday

05:00 to 05:59
PumpA - OFF Everyday
PumpB - ON Everday

06:00 to 21:59
PumpA - ON Everyday
PumpB - ON Everyday

If some tweaking is necessary, that is fine. I just cant seem to make this work. Virtual Outlets might be the way to go. I feel like I am doing it the hard way. This code might be all out of wack, my brain is having trouble working in 4 dimensions when I don't truely understand the rules.


Return Pump Test

Fallback ON
Set ON
If FeedA 020 Then OFF
If FeedB 001 Then OFF
If FeedC 001 Then OFF
If FeedD 001 Then OFF
If DoW -M---F- Then OFF
If Time 00:00 to 01:59 Then OFF



PumpA Test

Fallback ON
Set ON
If FeedA 000 Then OFF
OSC 060:00/060:00/060:00 Then OFF
If Time 06:00 to 21:59 Then ON
If Time 02:00 to 04:59 Then OFF



PumpB Test

Fallback ON
Set ON
If FeedA 000 Then OFF
OSC 000:00/060:00/060:00 Then OFF
If Time 06:00 to 21:59 Then ON
If Time 02:00 to 04:59 Then OFF
 
In most cases when programming an outlet, you start with a base condition... Set ON, Set OFF, or an OSC. Another way to look at it is that one of these statements sets the default state of the outlet. You then add exceptions or modifications to that using various If statements. Each IF statement modifies the tentative state of the outlet when the If statement is true. After all subsequent statements are evaluated in top to bottom sequence, then the final state of the outlet is sent to the outlet. So, the order of the statements is critical.

Fallback ON
Set ON
If FeedA 020 Then OFF
If FeedB 001 Then OFF
If FeedC 001 Then OFF
If FeedD 001 Then OFF
If DoW -M---F- Then OFF
If Time 00:00 to 01:59 Then OFF

In your code snippet above, the sequence is wrong - the outlet would be off all day long on MON & FRI and from 0-2AM on all other days.


Fallback ON
Set ON
If Time 00:00 to 01:59 Then OFF
If DoW S-TWT-S Then ON
If FeedA 020 Then OFF
If FeedB 001 Then OFF
If FeedC 001 Then OFF
If FeedD 001 Then OFF

In the modified code above, the If Time would shut the outlet off from 0-2AM every day, except that the If DoW overrides this on all days except M & F. So, the end result is that the pump is off from 0-2AM Mon & Fri.

That was fairly easy. But trying to use DoW in conjunction with OSC and your rather unusal needs for the powerheads is a nightmare. So, we're are going to use a virtual outlet as a flag to indicate when it is 0-2AM on Monday or Friday, and use that flag in all three outlets. We don't need to use a VO in the returm pump outlet, but we're going to for the sake of consistency.


[MONandFRI] (a virtual outlet)
Set OFF
If Time 00:00 to 01:59 Then ON
If DoW S-TWT-S Then OFF

[ReturnPump]
Fallback ON
Set ON
If Outlet MONandFRI = ON Then OFF

[PumpA]
Fallback ON
OSC 0:00/60:00/60:00 Then ON
If Outlet MONandFRI = ON Then ON
If Time 2:00 to 3:59 Then OFF
If Time 6:00 to 21:59 Then ON

[PumpB]
Fallback ON
OSC 60:00/60:00/0:00 Then ON
If Outlet MONandFRI = ON Then ON
If Time 2:00 to 3:59 Then OFF
If Time 6:00 to 21:59 Then ON

OSC includes both ON and OFF states, so a Set statement is not needed in the pump outlets. The If Outlet statement forces the outlet ON during your 0-2AM M/F period, then the two If Time statements in each pump outlet forces them ON from 6-22, and OFF from 2-4 as you desired.

But IMO, the above is really a poor use of OSC, since it is only actually used for a few hours per day. It's probably better to keep it simple with this:

[ReturnPump]
Fallback ON
Set ON
If Time 00:00 to 01:59 Then OFF
If DoW S-TWT-S Then ON

[PumpA]
Fallback ON
Set OFF
If Time 1:00 to 1:59 Then ON
If DoW S-TWT-S Then OFF
If Time 22:00 - 22:59 Then ON
If Time 0:00 - 0:59 Then ON
If Time 4:00 - 4:59 Then ON
If Time 6:00 to 21:59 Then ON

[PumpB]
Fallback ON
Set OFF
If Time 00:00 to 0:59 Then ON
If DoW S-TWT-S Then OFF
If Time 23:00 - 23:59 Then ON
If Time 1:00 - 1:59 Then ON
If Time 5:00 - 5:59 Then ON
If Time 6:00 to 21:59 Then ON

I did not include any If FeedX statements... add them below the other programming if desired.
 
This is extremely helpful to solve my current problem. Thank you very much. I figured I was making it more difficult than it needed to be, but once I was on that track, my brain wouldn't let go and I started to lose focus.

So that I understand the rules correctly, it doesn't seem intuitive, but it appears that I need to work backward from the bottom to the top of the statement hierarchy to find my solution. Does that approach help?

So for clarification.

The ocelots... 000:00/060:00/060:00 Then ON
The first ocelot is the offset from midnight? Meaning the OSC starts right at midnight?

The second ocelot means it will run for 60 minutes starting at midnight, and the third ocelot is how long the outlet will be off before it starts again? I haven't seen enough examples of this to keep me from messing it up.

OSC 060:00/060:00/000:00 Then ON
The first is the offset from midnight, meaning the outlet will wait 60 minutes before turning on, then the second means it will run for 60 minutes, then the third means there is no delay in minutes before it starts at the beginning?

This is the part that looses me, I don't understand the rules. When I Google other peoples solutions, I understand some and some I don't. I reread the manual, but I guess there aren't enough example to explain this well enough for me to grasp it. I guess someone should create a test with a dozen or so examples to solve.

I will forgo the use of OSC and use your recommendations, but it still doesn't explain the ocelots any better. Anything you can think of that will help me? Maybe some more detailed explanation or link that might break free my mental block?

Once again, Thank you and I appreciate the solution.
 
Maybe this will help.

Think of 1 complete cycle = OFF + ON + OFF.

If you wanted your cycle to run at 15 minutes after the hour, then your first param would be 15:00. If you wanted your cycle to start on the hour, then leave the first param at 0.

To carry that example further, you want it to run at 15 minutes after the hour for 5 minutes. So you would use 15:00/5:00/40:00. Your times don't have to add up to 60 minutes, I'm just using that as an example that's easy to visualize. In this case they do.

So that's 1 full cycle. OFF + ON + OFF.

Suppose you had two power heads that you wanted to stagger. You could do this:

power head #1 OSC 5:00/5:00/5:00
power head #2 OSC 0:00/5:00/5:00

What will happen is the power heads will alternate for 5 minutes ON, 5 minutes OFF but they won't be ON or OFF at the same time. That first param is what gives you that ability to stagger.

So you can use that first param to either offset your cycle from the top of the hour (again, you don't have to use a 60 minute cycle but most people do) OR you can use it to control multiple power heads in some sort of sequence.

Does that help?
 
Ok, so 15:00/5:00/40:00

The pump starts 15 minutes after the hour, and runs for 5 minutes. What does the 40:00 mean? That the cycle starts over in 40 minutes?

So starting at midnight. The pump starts at 00:15, and shuts off at 00:20. Then the pump starts back up at 01:00 or the 15 minute delay starts again, and the pump starts back up at 01:15 and runs until 01:20?

What is the difference between:
OSC 015:00/005:00/040:00 Then ON
and
OSC 015:00/005:00/040:00 Then OFF

This is helping... thanks
 
The total OSC cycle time is the sum of all three time values. So in your example OSC 015:00/005:00/040:00 Then ON, the OSC cycle will repeat every 60 minutes. It will be OFF for the first 15 minutes of each hour, ON for 5 minutes, then OFF for 40 minutes. Lather rinse repeat. So, the next cycle will be identical... OFF for 15, on for 5, etc. So, yes: So starting at midnight. The pump starts at 00:15, and shuts off at 00:20. Then the pump starts back up at 01:00 or the 15 minute delay starts again, and the pump starts back up at 01:15 and runs until 01:20 is correct.

With OSC 015:00/005:00/040:00 Then OFF, the ON/OFF is reversed - ON for 15 minutes, OFF for 5, ON for 40.

The OSC x/y/z Then ON syntax is most commonly used. The alternate syntax using OFF is rarely used it seems, but can be useful, for example, when creating staggered patterns of operation for multiple powerheads.

OSC does not actually start over at midnight each day. The OSC timing is calculated based on the number of seconds since January 1 of some year in the past (which I don't recall at the moment). So, if you have an oddball OSC such as 131:20/338:00/951:40 (1421 minutes), it will not "start" at midnight each day except on those rare occasions when the OSC counter just happens to coincide with midnight on the system clock. Since most of us use OSC values which add up to nice round sums such as one minute, one hour, 4 hours, or one day, etc., the outcome gives the appearance that it starts at midnight. Stick with those nice round values, and you won't have to worry about this intricacy.
 
Ok, now maybe it will stick in my head better. Thank you for your help. Hopefully others will be helped as well.
 
Back
Top