Apex Programming Question

shafiq_hossain

Member
Market
Messages
228
Reaction score
0
Does Apex give the ability to trigger an event based on multiple qualifiers? For example, let's say I want to turn off the pump based on the state of of multiple float switches. Can I say "turn off pump if Switch 1 = Off and Switch 2 = ON"? I've looked at different examples of coding but have not seen an AND clause used.

Thanks....
 
You can do it. I'll have to dig out my manual to see the wording. Are you doing automated water change programming?
 
cr500_af;735517 wrote: You can do it. I'll have to dig out my manual to see the wording. Are you doing automated water change programming?


the AND string does work?

In that acse the programming for my RODI outlet would be soo easy.

if switch A OFF and switch B ON then ON
if switch B OFF and switch A ON then OFF
if switch A ON and switch B ON then ON
if switch A OFF and switch B OFF then OFF
 
No, not necessarily the AND string. I think you have to set up a virtual outlet to make action depend on two float switches.
Edit: "and" does not work. Stand by; I found the method

Edit: The example I found isn't using float switches, but you get the idea.

Suppose you wanted the day to be Tuesday AND the time to be 4pm-5pm for this outlet to be ON.

Ex 1:
Set OFF
If DoW -T----- Then ON
If Time 16:00 to 17:00 Then ON

*This example won't work. It is an "OR" condition... if it's either Tuesday OR 4pm-5pm then the outlet would be ON.

Ex 2:
Set OFF
If DoW -T----- Then ON
If Time 17:00 to 16:00 then OFF

* This one works, and is essentially an "AND". The controller sets the condition to ON if the day is Tuesday (or in your example, float off/on), then turns it back OFF if the time is OTHER than 4-5.

So, assuming you want this outlet normally ON, this should work:

Set ON
If switch_2 ON then OFF
If switch_1 ON then ON

Line 2 tells it to turn off if the first qualifier is met.
Line 3 tells it that unless the second qualifier is met then reverse that "decision".

Remember that with multiple condition calls like this, the last one will always supercede the one before it.

I THINK that's right, but once you see how it works in the Apex's "brain" then you can change the statements to suit your needs.
 
Back
Top