View Full Version : AC jr programming question
kjdeut
05-20-2007, 09:59 PM
I have finally upgraded to the latest firmware and hooked up the dosing pump. I have tested turning the dosing pump off and on manually and it worked. I am currently adding 100ml of the 2 part p/day and would like to roughly spread this out over the 12 hour period my MH lighting is off.
I am using the time my second MH truns off as the starting point and have entered 2 programs, 1st is "if LT2 = off then DOS ON", DOS being the dosing pump. Second program is "OSC 002/076 ON/OFF THEN DOS OFF". What I am thinking is that this will dose for 2 minutes every 76 minutes starting roughly when the seconnd MH turns off, and stops when LT2 turns back on in the morinng.
I am second guessing myself on if this is the best way or not. As I'm typing i'm asking myself if I should set the state of the dosing pump (first program) by using the specific time instead of the state of LT2. Any comments/suggestions would be appreciated.
thanks,
ken
Chris Goetz
05-21-2007, 10:19 AM
What would happen if you turn LT2 off manually for some reason?
Would the dosing pump kick on and run more than expected?
I'd be tempted to hard code the on/off and run times independent of anything except maybe a float switch or probe(if pertinent?).
Chris
David Grigor
05-21-2007, 11:58 AM
If you use the "if lt2 off then dos on" like you suggested, I believe the on will override the osc command and stay on the whole time the lights are out. Also, I'd personally go with the smallest increment more frequently. So I'd use 1 minute on.
I know this works:
OSC 001/038 ON/OFF THEN DOS ON
If lt2 ON then dos off
If you not using all 12 ports you can set up an intermediate variable lets call DAY with one of the ports your not using ( 9-12 ).
if time > 10:00 then day on
if time > 22:00 then day off
then use the day variable for your off commad. This will get around Chris's concern that if you manually turn on your lights you may start dosing when you don't want to:
OSC 002/076 ON/OFF THEN DOS ON
If DAY ON then dos off
In my case I have both dc8 and dc4 hooked up and don't have any free ports so I can't use any intermediate variables and have it setup with the lights directly ( for my kalkwasser program ).
kjdeut
05-21-2007, 11:59 AM
Good point, thanks Chris. I decided to go with specific times last night and made the change. I enterend the on after 9:00pm and off after 9am commands. Then I entered the OSC 002/076 ON/OFF program whcih doesnt seem to be working. The dosing pump will come on but is doesnt turn off after 2 minutes. Not sure what is happening. I remeber David G saying something about problemsd with it turning on and off, but I thought the firmware update took care of it.
Ken
David Grigor
05-21-2007, 12:04 PM
Ken, I explained what's happening in my above post. The way you have the conditional lights was backwards and why the osc was not happening becuase you told it to be on. Remember is does the last true statement. If "lt1 off then dose on" is true so it stays on and never looks at the osc command......
kjdeut
05-21-2007, 12:14 PM
Thanks David I will give this a try. The dosing pump used up the last port on my DC8.
Ken
If you use the "if lt2 off then dos on" like you suggested, I believe the on will override the osc command and stay on the whole time the lights are out. Also, I'd personally go with the smallest increment more frequently. So I'd use 1 minute on.
I know this works:
OSC 001/038 ON/OFF THEN DOS ON
If lt2 ON then dos off
If you not using all 12 ports you can set up an intermediate variable lets call DAY with one of the ports your not using ( 9-12 ).
if time > 10:00 then day on
if time > 22:00 then day off
then use the day variable for your off commad. This will get around Chris's concern that if you manually turn on your lights you may start dosing when you don't want to:
OSC 002/076 ON/OFF THEN DOS ON
If DAY ON then dos off
In my case I have both dc8 and dc4 hooked up and don't have any free ports so I can't use any intermediate variables and have it setup with the lights directly ( for my kalkwasser program ).
David Grigor
05-21-2007, 12:53 PM
Okay but unless you have a DC4 hooked up you still have 4 addressable variables you can use. Typically DC8 is configured as A1-8. You can set up a new name called DAY for example and address it to A9 or B1 for example. If iteself will never turn anything on/off because you don't have anything assigned to the port but can then use it as a intermediate variable in the above example. You can use up to 12 ports/variables on a Jr.
In my case, I have a DC8 & DC4 so mine is maxed out and all ports in use so I can't setup as DAY as a variable because I'm using all 12 ports so I have to use the Lights in my program.
Hope that makes sense to you.
kjdeut
05-21-2007, 01:07 PM
ok, now i see what you are getting at. This way the "day" drives the power on or off so I dont have to worry about tunring off lt2 and having the doising pump come on. Thanks for clarifing.
storrisch
05-21-2007, 01:36 PM
this reminds me of writing TI-85 calculator programs in high school to cheat. I would program the start of a game and then was able to turn it into a math program to cheat on tests...
programming makes me want to rip my hair out when it doesnt work and you have to go back and find the hole.
David Grigor
05-21-2007, 03:06 PM
ok, now i see what you are getting at. This way the "day" drives the power on or off so I dont have to worry about tunring off lt2 and having the doising pump come on.
Bingo.
Very important to remember when reading your commands/code that when you combine commands it is still just whatever the last true statement is ( except for time which has priority over everything and why you must use a variable or another timer in this case).
kjdeut
05-21-2007, 04:55 PM
thanks again david. I have the "day" variable set-up, aadded the programming for time on and off, then added the OSC and the "if day off DOS on" command.
David Grigor
05-21-2007, 06:43 PM
Hopefully that's a typo, you have it backwards........
"If day on the dose off" is what you want in conjuction with the osc command. Your way it will stay on all night because the day statment is true never evaluating the osc command. Remember it will only do the last true statement.
Take a look at it again:
OSC 002/076 ON/OFF THEN DOS ON
If DAY ON then dos off
When days are on the 2cd statement is false so it will evaluate the first statment and start oscillating because statement 1 is true.
Then days are on the 2cd statement is true so dos stops there never evaluating the first statement.
Now look at it the way you wrote it:
OSC 002/076 ON/OFF THEN DOS ON
If DAY Off then dos on
As long as the second statement is true ( day off ) it will stay on until that statment becomes false. It isn't smart enough to also evaluate the first statement. The dos will stay on the entire time the days are off which is not what you want it to do.
kjdeut
05-21-2007, 09:28 PM
Thanks for double checking David I really appreciate it. I did enter it right in the Jr and typed it wrong in my post.
Ken
David Grigor
05-23-2007, 01:09 PM
Doing what your looking for thus far ?
I mean't to suggest that for the first few days you might want to still do manual dosing and have the doser just dump into a measuring cup rather than directly to the tank so you can make sure it works the way you intended and don't overdose the tank. Two part being so concentrated you just don't want to overdose particualarly the KH swing can really cause serious RTN.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.