Revision 1.1
Timer Variables
Six timers are available for use in BASIC scripts. They are designated as t0 through 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 100ms until it reaches zero.
Examples:
Let t3 = 1500
Let t1 = 0
Internal Relay Variables
The internal relays can be turned on, turned off, pulsed, toggled, or read in BASIC scripts. The LET
statement is used to set the internal relay state. The state options available are 0 (turn outlet off), 1 (turn
outlet on), 2 (pulse outlet), and 5 (toggle outlet). Note that the pulse time is specified in the Outlets
setup tab. Internal relays are designated as relay1 and relay2, which correspond to Outlet1 and Outlet2.
Examples:
Let relay1 = 1
Let relay2 = 0
Let relay1 = 2
Let relay2 = 5
Let a = relay2
Input Variables
The input states can be read in BASIC scripts. The inputs are designated as input1 and input2.
Example:
Let a = input1
Temperature/Humidity Sensor Variables
Each temperature sensor can be read in BASIC scripts. The temperature sensors are designated as
temp1, temp2, and temp3.
Example:
If temp2 >= 80 Then
End If
Xytronix Research & Design, Inc.
'set timer 3 to 150 seconds
'disable time 1
'turn on relay 1
'turn off relay 2
'pulse relay 1
'toggle relay 2
'read the state of relay 2, state will be 0 or 1
'sets 'a' equal to value of input 1
Let relay2 = 1
'If temperature sensor reads greater than 80
' degrees, then
'Turn on relay 2
WebSwitch™ Users Manual
102
Need help?
Do you have a question about the WebSwitch XRDI-WS3 and is the answer not in the manual?