Programming Apex help

AnacapaReefs

Lover of Corals
View Badges
Joined
Nov 14, 2019
Messages
113
Reaction score
86
Location
Santa Barbara
Rating - 0%
0   0   0
I have two temp probes Tmp_L and Tmp_R. Id like to set them up so that if one fails, it sends me an alert, and falls back to the other. This would have to go both ways. I use them to control my heaters.
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,228
Location
Oregon
Rating - 0%
0   0   0
The big question is: How would you know if one failed from a programming perspective?
 
OP
OP
AnacapaReefs

AnacapaReefs

Lover of Corals
View Badges
Joined
Nov 14, 2019
Messages
113
Reaction score
86
Location
Santa Barbara
Rating - 0%
0   0   0
If it would work, I would get a third probe and if one is reading differently then the other two, it would ignore it.
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,228
Location
Oregon
Rating - 0%
0   0   0
Unfortunately the Apex programming language does not permit any way to directly compare two probe readings. The best you can do is to compare a probe value against a static number; for example:

If Tmp_L < 78.0 Then ON

In order to compare multiple probe readings, you'd need to utilize a virtual output:

TmpL_Compare
------------------------
Set OFF
If Tmp_L < 78.0 Then ON

TmpR_Compare
-----------------------
If Output TmpL_Compare = ON Then ON
If Tmp_R > 78.0 Then OFF

So if output TmpR_Compare = OFF, then that means that Tmp_L is reading lower than Tmp_R.

As you can see, this isn't really scalable because you might need to compare things over a range of temperatures.
 
OP
OP
AnacapaReefs

AnacapaReefs

Lover of Corals
View Badges
Joined
Nov 14, 2019
Messages
113
Reaction score
86
Location
Santa Barbara
Rating - 0%
0   0   0
Unfortunately the Apex programming language does not permit any way to directly compare two probe readings. The best you can do is to compare a probe value against a static number; for example:

If Tmp_L < 78.0 Then ON

In order to compare multiple probe readings, you'd need to utilize a virtual output:

TmpL_Compare
------------------------
Set OFF
If Tmp_L < 78.0 Then ON

TmpR_Compare
-----------------------
If Output TmpL_Compare = ON Then ON
If Tmp_R > 78.0 Then OFF

So if output TmpR_Compare = OFF, then that means that Tmp_L is reading lower than Tmp_R.

As you can see, this isn't really scalable because you might need to compare things over a range of temperatures.
Thanks!
 

Freshwater filter only or is it? Have you ever used an HOB filter on a saltwater tank?

  • I currently use a HOB filter on my reef tank.

    Votes: 34 29.1%
  • I don’t currently use a HOB filter on my reef tank, but I have in the past.

    Votes: 21 17.9%
  • I have used a HOB on fish only or quarantine tanks, but not on the display tank.

    Votes: 28 23.9%
  • I have never used a HOB on a saltwater tank.

    Votes: 32 27.4%
  • Other.

    Votes: 2 1.7%
Back
Top