I am trying to use 3 BRS dosing pumps to dose Alk, Ca and Mg. I would like to use the internal memory parameters in the Android application to set the length of time to run each pump so that I do not have to upload code to the RA controller each time I want to change the length of time (in seconds) the pumps run. Here is the code that I think I need to add:
#define Dose_Alk Port2 // Dosing Pump Alk
#define Dose_Ca Port3 // Dosing Pump Ca
#define Dose_Mg Port4 // Dosing Pump Mg
#define Dose_Alk_Seconds 100 // Number of seconds to dose Alk
#define Dose_Ca_Seconds 101 // Number of seconds to dose Ca
#define Dose_Mg_Seconds 102 // Number of seconds to dose Mg
ReefAngel.DosingPumpRepeat( Dose_Alk,0,60,InternalMemory.read(Dose_Alk_Seconds));
ReefAngel.DosingPumpRepeat( Dose_Ca,0,60,InternalMemory.read(Dose_Ca_Seconds));
ReefAngel.DosingPumpRepeat( Dose_Mg,10,60,InternalMemory.read(Dose_Mg_Seconds));
Why is this not working for me?
I want to use 3 dosing pumps and use Internal Memory parms.
Re: I want to use 3 dosing pumps and use Internal Memory par
Did you initialize the memory locations before trying to use them? I mean, did you set the values to either 0 or to the desired value?
Re: I want to use 3 dosing pumps and use Internal Memory par
Yes, I think so. I went into the Memory menu option of the Android application and selected the "Custom Location" selection set the Location to 100 and selected entered 90 for the Byte and Int option (because I was not sure which one that it used), then I hit the "Write value" button.binder wrote:Did you initialize the memory locations before trying to use them? I mean, did you set the values to either 0 or to the desired value?
When I select the "Read value" option it says...
Location 100 for Byte value = 90, Int value = 23130
Location 101 for Byte value = 90, Int value = 15450
Location 102 for Byte value = 60, Int value = 60
The Byte values are the values that I entered. The Int values have been changed for 100 and 101. 102 is correct though.
Does this seem correct?
Re: I want to use 3 dosing pumps and use Internal Memory par
You will want to use Byte values. That is how your code is set to read from memory. So make sure the Byte values read the proper values.
Re: I want to use 3 dosing pumps and use Internal Memory par
Curt, I changed the code to use InternalMemory.read_int and now it works correctly.binder wrote:You will want to use Byte values. That is how your code is set to read from memory. So make sure the Byte values read the proper values.
Example:
ReefAngel.DosingPumpRepeat( Dose_Alk,0,60,InternalMemory.read_int(Dose_Alk_Seconds));
Thanks for your help.
Re: I want to use 3 dosing pumps and use Internal Memory par
ok great. glad you got it working. the only thing that concerns me is that int's use 2 storage locations instead of 1. so your locations should be 100,102,104. However, since your values being stored are so small (less than 255), your code is working properly. i would just keep an eye on it and make sure it continues to work as planned.mudcat1 wrote:Curt, I changed the code to use InternalMemory.read_int and now it works correctly.binder wrote:You will want to use Byte values. That is how your code is set to read from memory. So make sure the Byte values read the proper values.
Example:
ReefAngel.DosingPumpRepeat( Dose_Alk,0,60,InternalMemory.read_int(Dose_Alk_Seconds));
Thanks for your help.
Re: I want to use 3 dosing pumps and use Internal Memory par
Curt, it is not working as expected. The values that I originally set are changing which makes me believe I am using memory locations that are already in use by some other standard code (ex 100, 102, 103...). Is there a range of memory locations that are reserved for the standard code? If so, what are they? Is there a range of memory locations that should be used for custom memory?
Re: I want to use 3 dosing pumps and use Internal Memory par
Curt, I changed my code to use "Byte" type as you suggested and it seems to be working now. I also think I found the answer to my other question in one of your other posts on the forum. You said that custom memory location are 0 to 199 and memory locations reserved for standard code are >= 200.binder wrote:ok great. glad you got it working. the only thing that concerns me is that int's use 2 storage locations instead of 1. so your locations should be 100,102,104. However, since your values being stored are so small (less than 255), your code is working properly. i would just keep an eye on it and make sure it continues to work as planned.mudcat1 wrote:Curt, I changed the code to use InternalMemory.read_int and now it works correctly.binder wrote:You will want to use Byte values. That is how your code is set to read from memory. So make sure the Byte values read the proper values.
Example:
ReefAngel.DosingPumpRepeat( Dose_Alk,0,60,InternalMemory.read_int(Dose_Alk_Seconds));
Thanks for your help.
Thanks again for your help.
Re: I want to use 3 dosing pumps and use Internal Memory par
Cool. Yeah, you are quite welcome.mudcat1 wrote: Curt, I changed my code to use "Byte" type as you suggested and it seems to be working now. I also think I found the answer to my other question in one of your other posts on the forum. You said that custom memory location are 0 to 199 and memory locations reserved for standard code are >= 200.
Thanks again for your help.