Displaying Custom Variables

Related to the Portal

Posts: 60
Joined: Wed Apr 27, 2011 9:08 am
PostPosted: Tue Mar 13, 2018 4:36 pm
How do you get the app to display custom variables that are set in internal memory? Is there a limit to how many custom variables can be displayed?

Thanks,
Tim
User avatar
Posts: 2732
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Wed Mar 14, 2018 7:44 am
which app are you referring to?
there’s a limit of 8 (0-7).


Sent from my iPad using Tapatalk

Posts: 60
Joined: Wed Apr 27, 2011 9:08 am
PostPosted: Wed Mar 14, 2018 10:10 am
I was referring to the Android uapp but would apply to the portal also.

Using the following in the loop section would allow me to view any custom internal memory data, but how would I change any the value of any custom defined internal memory value?


ReefAngel.CustomVar[0] = /*any type of internal memory variable*/;
...
...
ReefAngel.CustomVar[7]=255;
User avatar
Posts: 2732
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
PostPosted: Sun Mar 18, 2018 6:29 am
the code you listed will assign a value to a custom variable.

i don’t follow what you are asking about changing a custom variable value?

are you wanting to change the values from the app? or from the controller in the code?

when you do what you listed, you are assigning a value to the variable.
ReefAngel.CustomVar[0]=2;
this assigns a value.

if (ReefAngel.CustomVar[0] > 1) {
// perform some task if the value is greater than 1
}

There are ways to read and assign custom variables through the wifi interface. The command is /cvarX,Y
Where X is the variable number to reference.
Where Y is the value to be stored.

If you just issue /cvarX the value will be returned.
If you issue /cvarX,Y the value of Y will be stored in the variable.

Without knowing more of what you want to do, i cannot provide any more help.
FYI, all of this information is stored inside the libraries.



Sent from my iPad using Tapatalk

Posts: 60
Joined: Wed Apr 27, 2011 9:08 am
PostPosted: Mon Mar 19, 2018 10:36 am
Thank for the explanation binder. I mixed up the uses for custom variables and the variables that are stored in the internal memory. The internal memory variables values as defined in the app or portal can be changed on the fly without the need for reloading the firmware. This wouldn't be true for a custom variable.

Thanks
Tim

Return to Portal

Who is online

Users browsing this forum: No registered users and 2 guests