apex code help!

BrianReefer

Well-Known Member
View Badges
Joined
Jul 28, 2016
Messages
838
Reaction score
546
Rating - 100%
1   0   0
Hi there

I currently use apex EL to control my BRS dosers for Alk and Cal. I use the OSC code to dosen 45 ml throughout the day

I also have an Alkatronic and now have it connected through the BNC port to my apex. So I’d like to add code that tells the apex to pause dosing if the Alkatronic says alk is over 8.2, but to continue the OSC dosing if it’s under 8.2. And obviously to default to off in case of an outage etc.

Can anyone help?
 

Sleepydoc

Valuable Member
View Badges
Joined
Apr 10, 2017
Messages
1,423
Reaction score
1,265
Location
Minneapolis, MN
Rating - 0%
0   0   0
You should be able to put an 'IF...then OFF' statement after the OSC statement in the outlet programming. I don't know the exact syntax for reading the Alkatronic, but the outlet programming would look something like:

OSC ... Then ON
If {Alkatronic > 8.2} THEN OFF

The OSC function would work like normal, but if the all reading is greater than 8.2 the 'then off' statement would trump the OSC statement.
 
OP
OP
B

BrianReefer

Well-Known Member
View Badges
Joined
Jul 28, 2016
Messages
838
Reaction score
546
Rating - 100%
1   0   0
Than you! And then once that condition were no longer true, it would trigger once again based on the OSC statement correct?
 

Sleepydoc

Valuable Member
View Badges
Joined
Apr 10, 2017
Messages
1,423
Reaction score
1,265
Location
Minneapolis, MN
Rating - 0%
0   0   0
Yes. With a couple of exceptions, the programming for outlets is evaluated in the order it's written. If a statement is False, nothing happens. A couple of things to note with this:
- if there is no SET statement the outlet state will only change if a statement tells it to. This comes into play for heater programming:

If Temp < 77 then ON
If Temp > 79 then OFF

If you look at the program, temps between 77 and 79 are undefined; Some people assume that if the temp is 78, the first IF statement would not be true and the outlet would turn off, but that's not the case. A statement only acts if it is true. here, no statement applies and so nothing happens.

I haven't used the OSC statement, I'm pretty sure it actively turns the outlet both off and on but good practice for a dosing outlet would be to include "Fallback OFF" and "Set OFF" as the first two statements in the program.
 

Caring for your picky eaters: What do you feed your finicky fish?

  • Live foods

    Votes: 12 27.3%
  • Frozen meaty foods

    Votes: 36 81.8%
  • Soft pellets

    Votes: 7 15.9%
  • Masstick (or comparable)

    Votes: 2 4.5%
  • Other

    Votes: 2 4.5%
Back
Top