Urchinhead

05/14/2009, 07:50 PM

I apologize as I am sure this has been asked and answered several times. For some reason though I can't find the answer and my Google-Fu is failing me.

Right now my code is monitoring two float switches...

A low water level switch for the sump that turns the return pump off if its tripped and a high water switch for the sump that turns off the ATO system (Tunze Ozmolator) and Dosing Controller (Profilux) if the water level is too high.

What I would like to be able to do is to turn these items off and on based on pH and ORP values or if the switch(s) are tripped. What I am finding is that if I code for a switch trip then then I can't get the device I want to control to go on/off based on a pH shift and vice versa. Is there a way to do that?

Here is the code I have so far:

SKM$-A01 // skimmer

RTN$-A02 // return pump

SMP$-A03 // small powerhead in sump to keep detritus stirred up

CLP$-A04 // closed loop pump

HTR$-A05 // heater

MP1$-A06 // Vortech MP40 #1

ATO$-A07 // ATO controller

REF$-A08 // Refugium light

CHL$-B01 // Chiller

DOS$-B02 // Dosing pump controller

T5A$-B03 // T5 Actinic lights

T5B$-B04 // T5 VHO lights

FAN$-B05 // Inside stand fan to move air for chiller

ALM#-P07 // big deal alarm

AL1#-P01 // low water alarm for return compartment of sump

AL2#-P02 // high water alarm for return compartment of sump

AL3#-P03 // pH too low alarm

AL4#-P04 // pH too high alarm

AL5#-P05 // ORP too low alarm

AL6#-P06 // ORP too high alarm

low%-N01 // turn of return pump if switch 1 is open because water is too low in sump

ovr%-n02 // turn off doser system and ATO if switch 2 is closed because water is too high in sump

// Set timers

If Time > 00:00 Then ALM OFF

If Time > 00:00 Then AL1 OFF

If Time > 00:00 Then AL2 OFF

If Time > 00:00 Then AL3 OFF

If Time > 00:00 Then AL4 OFF

If Time > 00:00 Then AL5 OFF

If Time > 00:00 Then AL6 OFF

If Time > 00:00 Then SKM ON

If Time > 00:00 Then SMP ON

If Time > 00:00 Then MP1 ON

If Time > 00:00 Then HTR ON

If Time > 00:00 Then CHL ON

// Lights come on

If Time > 18:00 Then T5A ON

If Time > 18:45 Then T5B ON

// Lights go off

If Time > 06:00 Then T5B OFF

If Time > 06:45 Then T5A OFF

// Refugium light on when main lights are off

If Timer T5A = OFF Then REF ON

// Temp Probe check. If faulty then shut all devices off and page me

If Temp < 73.0 Then CHL OFF

If Temp < 73.0 Then HTR OFF

If Temp < 73.0 Then FAN OFF

If Temp < 73.0 Then REF OFF

If Temp < 73.0 Then T5A OFF

If Temp < 73.0 Then T5B OFF

If Temp < 73.0 Then ALM ON

If Temp > 86.0 Then CHL OFF

If Temp > 86.0 Then HTR OFF

If Temp > 86.0 Then FAN OFF

If Temp > 86.0 Then REF OFF

If Temp > 86.0 Then T5A OFF

If Temp > 86.0 Then T5B OFF

If Temp > 86.0 Then ALM ON

// Regular temp controls

If Temp > 78.0 Then FAN ON

If Temp > 80.0 Then HTR OFF

If Temp > 80.0 Then REF OFF

If Temp > 82.0 Then T5B OFF

Max Change 015 M Then T5B OFF

If Temp > 83.0 Then T5A OFF

Max Change 015 M Then T5A OFF

// Monitor pH and ORP

If pH < 8.10 Then AL3 ON

If pH > 8.60 Then AL4 ON

If ORP < 300 Then AL5 ON

If ORP > 450 Then AL6 ON

// Monitor float switches

If Switch1 Closed Then low OFF

If Switch1 Closed Then AL1 OFF

If Switch1 Open Then low ON

if switch1 open then al1 on

If Switch2 Open Then OVR OFF

If Switch2 Open Then AL2 OFF

If Switch2 Closed Then OVR ON

If Switch2 Closed Then AL2 ON

// Actions if either float switch is tripped

If Timer low = OFF Then RTN ON

if timer low = on then RTN off

if timer ovr = off then dos on

if timer ovr = off then ato on

if timer ovr = on then dos off

if timer ovr = on then ato off

// Tell me if the power went out

If Power 000 Then ALM ON

// Feed the tank

if FeedA 000 then SKM OFF

If FeedA 000 Then RTN OFF

If FeedA 000 Then OVR OFF

If FeedA 000 Then CLP OFF

If FeedA 000 Then MP1 OFF

Right now my code is monitoring two float switches...

A low water level switch for the sump that turns the return pump off if its tripped and a high water switch for the sump that turns off the ATO system (Tunze Ozmolator) and Dosing Controller (Profilux) if the water level is too high.

What I would like to be able to do is to turn these items off and on based on pH and ORP values or if the switch(s) are tripped. What I am finding is that if I code for a switch trip then then I can't get the device I want to control to go on/off based on a pH shift and vice versa. Is there a way to do that?

Here is the code I have so far:

SKM$-A01 // skimmer

RTN$-A02 // return pump

SMP$-A03 // small powerhead in sump to keep detritus stirred up

CLP$-A04 // closed loop pump

HTR$-A05 // heater

MP1$-A06 // Vortech MP40 #1

ATO$-A07 // ATO controller

REF$-A08 // Refugium light

CHL$-B01 // Chiller

DOS$-B02 // Dosing pump controller

T5A$-B03 // T5 Actinic lights

T5B$-B04 // T5 VHO lights

FAN$-B05 // Inside stand fan to move air for chiller

ALM#-P07 // big deal alarm

AL1#-P01 // low water alarm for return compartment of sump

AL2#-P02 // high water alarm for return compartment of sump

AL3#-P03 // pH too low alarm

AL4#-P04 // pH too high alarm

AL5#-P05 // ORP too low alarm

AL6#-P06 // ORP too high alarm

low%-N01 // turn of return pump if switch 1 is open because water is too low in sump

ovr%-n02 // turn off doser system and ATO if switch 2 is closed because water is too high in sump

// Set timers

If Time > 00:00 Then ALM OFF

If Time > 00:00 Then AL1 OFF

If Time > 00:00 Then AL2 OFF

If Time > 00:00 Then AL3 OFF

If Time > 00:00 Then AL4 OFF

If Time > 00:00 Then AL5 OFF

If Time > 00:00 Then AL6 OFF

If Time > 00:00 Then SKM ON

If Time > 00:00 Then SMP ON

If Time > 00:00 Then MP1 ON

If Time > 00:00 Then HTR ON

If Time > 00:00 Then CHL ON

// Lights come on

If Time > 18:00 Then T5A ON

If Time > 18:45 Then T5B ON

// Lights go off

If Time > 06:00 Then T5B OFF

If Time > 06:45 Then T5A OFF

// Refugium light on when main lights are off

If Timer T5A = OFF Then REF ON

// Temp Probe check. If faulty then shut all devices off and page me

If Temp < 73.0 Then CHL OFF

If Temp < 73.0 Then HTR OFF

If Temp < 73.0 Then FAN OFF

If Temp < 73.0 Then REF OFF

If Temp < 73.0 Then T5A OFF

If Temp < 73.0 Then T5B OFF

If Temp < 73.0 Then ALM ON

If Temp > 86.0 Then CHL OFF

If Temp > 86.0 Then HTR OFF

If Temp > 86.0 Then FAN OFF

If Temp > 86.0 Then REF OFF

If Temp > 86.0 Then T5A OFF

If Temp > 86.0 Then T5B OFF

If Temp > 86.0 Then ALM ON

// Regular temp controls

If Temp > 78.0 Then FAN ON

If Temp > 80.0 Then HTR OFF

If Temp > 80.0 Then REF OFF

If Temp > 82.0 Then T5B OFF

Max Change 015 M Then T5B OFF

If Temp > 83.0 Then T5A OFF

Max Change 015 M Then T5A OFF

// Monitor pH and ORP

If pH < 8.10 Then AL3 ON

If pH > 8.60 Then AL4 ON

If ORP < 300 Then AL5 ON

If ORP > 450 Then AL6 ON

// Monitor float switches

If Switch1 Closed Then low OFF

If Switch1 Closed Then AL1 OFF

If Switch1 Open Then low ON

if switch1 open then al1 on

If Switch2 Open Then OVR OFF

If Switch2 Open Then AL2 OFF

If Switch2 Closed Then OVR ON

If Switch2 Closed Then AL2 ON

// Actions if either float switch is tripped

If Timer low = OFF Then RTN ON

if timer low = on then RTN off

if timer ovr = off then dos on

if timer ovr = off then ato on

if timer ovr = on then dos off

if timer ovr = on then ato off

// Tell me if the power went out

If Power 000 Then ALM ON

// Feed the tank

if FeedA 000 then SKM OFF

If FeedA 000 Then RTN OFF

If FeedA 000 Then OVR OFF

If FeedA 000 Then CLP OFF

If FeedA 000 Then MP1 OFF