Displaying Custom Variables

Related to the Portal
Post Reply
tngo
Posts: 131
Joined: Wed Apr 27, 2011 9:08 am

Displaying Custom Variables

Post by tngo »

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
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Displaying Custom Variables

Post by binder »

which app are you referring to?
there’s a limit of 8 (0-7).


Sent from my iPad using Tapatalk
tngo
Posts: 131
Joined: Wed Apr 27, 2011 9:08 am

Re: Displaying Custom Variables

Post by tngo »

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;
binder
Posts: 2871
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: Displaying Custom Variables

Post by binder »

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
tngo
Posts: 131
Joined: Wed Apr 27, 2011 9:08 am

Re: Displaying Custom Variables

Post by tngo »

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
Post Reply