Programming Apex help

AnacapaReefs

Lover of Corals
View Badges
Joined
Nov 14, 2019
Messages
113
Reaction score
86
Location
Santa Barbara
What state or country do you live in
California
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.
 
The big question is: How would you know if one failed from a programming perspective?
 
If it would work, I would get a third probe and if one is reading differently then the other two, it would ignore it.
 
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.
 
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!
 

WHAT MOST MAKES A BLACK FRIDAY REEF DEAL WORTH CONSIDERING?

  • A real discount on something already on my list

    Votes: 52 77.6%
  • Free or reduced shipping

    Votes: 12 17.9%
  • A useful bundle of gear or supplies

    Votes: 3 4.5%
  • A good price on livestock I’ve already researched

    Votes: 16 23.9%
  • A rare chance to get something hard to find

    Votes: 15 22.4%
  • A seller or brand I trust

    Votes: 14 20.9%
  • I buy when I need something, sale or not

    Votes: 13 19.4%
  • Other (Post in the comments)

    Votes: 1 1.5%
Back
Top
Home
Post thread…
Market
What's new