PDA

View Full Version : Multiple OSC code in one program(more funky code)


ToLearn
01/19/2011, 11:59 PM
I am hoping this will allow me to do what I want to, but not sure if it will work or if is the best way.

I want to amend my Kalkwasser dosing code so that not only does it run at night when top off water is needed and the pH isn't too high, but it also runs just a little bit periodically during the day regardless if the sump is low or not.(I could certainly use the extra kalkwasser with out risk of over dosing or raising the pH too high).

Would this code work the way I want it to?

Fallback OFF
OSC 000:30/000:08/000:00 Then ON
Min Time 000:10 Then ON
If Time 15:55 to 21:50 Then OFF
If Outlet SumpLow = OFF Then OFF
OSC 025:00/000:03/000:00 Then ON
If pH > 08.27 Then OFF
If Outlet SumpNotFull = OFF Then OFF
If Outlet ATOResEmpty = OFF Then OFF
If Outlet ATO_TooLong = ON Then OFF
If Outlet XWRONGX = ON Then OFF
If FeedA 002 Then OFF
If FeedB 002 Then OFF
If FeedC 000 Then OFF


(Background: One reason I am doing this is I am using a Sprung TLF KW300 reactor that relies on the dosing pump to stir the kalk. I don't want it to cake up on the bottom and I want it to remain fully saturated. I love the reactor btw, just want to run it optimally. )

swearint
01/20/2011, 08:10 AM
Combining two OSC statements in the same outlet will not do what you want. The way that the Apex executes statements the second one will dominate. If the first one is ON and the second one is OFF, the result will be OFF, and vice versa. If you need two different modes, you will need to create seperate virtual outlets. You might search out some of the threads for ideas where people are creating different wavemaker modes or lighting schemes.

I have mentioned this before, but using a Min Time statement when using an OSC does not make sense and overly complicates the code. Keep in mind that both Min Time and Defer are evaluated last, regardless of where they appear in the code. The OSC is the only statement in your code that creates an ON state. The Min Time will hold it for a total of 10 seconds. Just eliminate the Min Time and change the OSC ON duration to 10 seconds.

Todd

ToLearn
01/20/2011, 11:34 AM
Understand on the OSC code.

You mentioned the min time before, but either I don't understand it or I disagree. Let me give an example of why I think it is helpful to have it in there.

With this code:
OSC 000:30/000:010/000:00 Then ON
Min Time 000:10 Then ON

At midnight it will be off for 30 seconds and could be on between 30 and 40 seconds after midnight if all the other conditions don't trip it off. But what happens if the other conditions besides the osc code keep it off for the first 38 seconds after midnight and at the 39th second it turns on? With out Min time it would come on for a second then off for 30 seconds and then on as long as it needs to be to fill. However because the Min time statement is in there it will keep the device on long enough that it actually does something.

If the conditions are going to turn the device on I would like it to stay on long enough that it actually does something. Many electrical devices, from my limited understand, are stressed by frequent on offs. Only having it on for 1, 2, or 3 seconds likely won't be long enough with the size pumps I am using to put enough water in to make any kind of difference.

Just changing the OSC on duration to 10 seconds won't do the same thing.

As far as overly complicating the code I don't think I'll confuse the Apex and I personally am not trying to time another event to happen a 11:28:52 and hoping I did the calculations so the kalk isn't going at the same time.

Do you follow where I'm coming from and does it make sense now? I could be completely wrong.

swearint
01/20/2011, 02:09 PM
OK, I finally see what you are doing. The only thing I would add though is that most of your conditions appear to be critical situations and I would think that you would want to shut off immediately. It seems unlikely that those situations would change rapidly enough to cause the pump to come back on.

Todd