ISY-99i/ISY-26 INSTEON:Integer Variables
- A signed integer (32 bit)
- Arithmetic operations available in Actions
- Comparison operations available in conditions
- Initialized at startup
- Changes to the value do not cause an event to be sent
- Identical to an Integer variable except that changes to the value do cause an event to be sent, causing programs to run
- The definitions for all the variables is under the Variables tab in Programs.
- When you add/remove/rename a variable you must save your changes before they will take effect.
- When you modify either the init value or the current value the change takes place immediately and you do not have to hit save.
- The timestamp column shows the last time the current value of the variable was changed.
- For both actions and conditions, variables are shown with just their name prefixed by $.
- For example, if you define a variable named counter it will show up as $counter in your programs.
- At start-up, all variables are initialized to their predefined init value, or zero, if no init value has been specified. The init value may be set by editing the init value in the table containing the variable definitions.
- The init value may also be set in programs, thus providing a means of persisting values across restarts.
x : A variable a : Either a variable or an integer constant
Initialize $x Init To a
This sets the init value for this variable, it does not modify the current value of the variable.
You may of course set the init value to the current value of the variable by doing this:
$x Init To $x
It may be desirable to maintain the value of some variables across restarts of the ISY. This must be done explicitly by changing the init value of the variable (as described above).
One of the reasons we don't automatically persist all of the variables is that the value of a variable would have to written to persistent storage (a file on the SD Card) each time it changes.
All operations are in the form $variable op <value or variable>.
Most operations do both a calculation and assignment, for example:
$counter += 1
is equivalent to the more familiar
$counter = $counter + 1
x : A variable a : Either a variable or an integer constant Assign $x = a Add $x += a Subract $x -= a Multiply $x *= a Divide $x /= a Remainder $x %= a And (binary) $x &= a Or (binary) $x |= a Xor (binary) $x ^= a