XW-210 WiFi™ Users Manual
6.7.4 User-Defined Variables
Two types of variables are available for use in the ControlByWeb™ BASIC interpreter, user-defined
variables, and predefined variables.
Up to 10 user variables may be initialized. These must be single character, lower case letters.
a, b, c, d, e, f, g, h, i, j
They are always global and stored internally as floating point numbers. Variables are defined using the
LET statement.
Examples:
Let b = 5
'variable b will be set to 5
Let d = b + 2
'variable d will be set to 7
6.7.5 Predefined Variables
The following are useful predefined variables for the ControlByWeb™ BASIC interpreter. These are
useful for accessing internal values and features states.
6.7.5.1 Timer Variables
Six timers are available for use in BASIC scripts.
t0, t1, t2, t3, t4, t5
Timers can be set to any positive integer (or 0) by using the LET statement. As soon as a value is
assigned to a timer, it will begin to count down immediately by decrementing one count every 100 ms
until it reaches zero.
Examples:
Let t3 = 1500
'set timer 3 to 150 seconds
Let t1 = 0
'disable time 1
6.7.5.2 Relay Variables
Relay variables represent the state of the relays and can be used to change the state of the relays.
Remote relays can also be controlled, but not read. The following variables are available.
relay1
'relay 1
rmt_relay1
'remote relay 1
rmt_relay2
Note: Commands can be sent to remote relays, but the states of those relays cannot be read.
Consequently, remote relays should not be used in safety or security-critical applications.
Relay outputs can be turned ON, turned OFF, pulsed, toggled, or read in BASIC scripts. The LET
statement is used to set the output state. The state options available are:
0 – turn relay off
1 – turn relay on
2 – pulse relay
5 – toggle relay
The pulse time is specified in the
Relay
setup tab.
Examples:
Let relay1 = 1
'turn on relay 1
Let relay1 = 0
'turn off relay 1
Let relay1 = 2
'pulse relay 1
Let relay1 = 5
'toggle relay 1
Let a = relay2
'read the state of relay 2, state will be 0 or 1
Xytronix Research & Design, Inc.
Page 79
Содержание WebRelay Wireless XW-210I
Страница 1: ......