Variables

Variables are sections of memory within the solution which can change their value. Variables have names, current values, and are organised into folders. Imagine a variable representing the current temperature of a property. The name of the variable might be Home Temperature and the value might be 21. The value may change over time.

System Variables

There are 3 types of variables in the DemoPad solution:


Local / Global Variables

It is important to note that, without a Centro-8 or Centro-8M processor, all variables are local to the control app; that is, their value is contained within the single app instance (iOS or Android device) and is not a global system value. Changing the variable value from one iOS / Android device has no effect on any others (in an environment where multiple apps are used).

However, with a Centro-8 / 8M it is possible to make variables global, so that a change to the variable's value is reported system-wide to all devices, and the value is persistant, using the memory of the Centro-8 / 8M.

In order to make a variable global, it needs to be 'ticked':

Flags

Note the option to 'tick' a variable will only be there if you have a Centro-8 / 8M in your project.

Not all variables should be global, depending on their use. For example, a flag which represents the state of something physical, such as whether the alarm system is set, or whether the front door is open, should be a global variable. It makes sense that each device should be made aware of any changes, and that the system as a whole should always know the value of the flag. Equally, some variables should not be global - for example a label which represents the room a particular app is controlling. It makes sense that the label should be able to change on one app (to allow the user to control a different room) without affecting other apps, which may be controlling other rooms.