XW-210 WiFi™ Users Manual
6.7.5.8 Event Variables
Data and time variables can be used to execute script events.
Up to five date variables are available.
ed1
'event date variable 1
…
'ed2, ed3, ed4
ed5
'event date variable 5
The value assigned to event variables should be in the format mm/dd/yyyy. The event date variables
store the number of days that have passed since January 1, 1970.
Event time variables may be used in math expressions as well as comparison statements.
Time variables have a similar naming convention.
et1
'event time variable 1
...
' et2, et3, et4
et5
'event time variable 5
Event time variables are declared in the format hh:mm:ss in 24-hour time. The event time variables store
the number of seconds from the beginning of the day.
Event date and event time variables of the same number are linked. If the event time variable is
incremented more than the number of seconds in a day (86400 seconds), the variable is reset to 0 and
the event date variable is incremented by one. For example, if et3 rolls over to zero, ed3 will be
incremented.
The following script example demonstrates defining the event variables and comparing it to the current
date and time. Assume current time is April 10, 2010 at 1:30 AM and the event should occur in one hour
and every hour thereafter.
Example:
Let a = 1
Let ed1 = 04/10/2010
'sets the event date to April 10,
'2010.
Let et1 = 02:30:00
'sets the event time to 2:30
Do While a <> 0
If ed1 >= date Then
'Tests event date versus current date.
If et1 >= time Then
'Tests event time versus current time.
Let et1 = et1 + 3600
'Increments the event time by one hour
'(in seconds).
Print "Event"
'Event to occur
End If
End If
Loop
End
6.7.6 Registers
Registers are similar to general purpose variables and can be used in the same manner. The difference
between general purpose variables and registers is that external registers can be accessed by the user
through a web browser and modified while the script is running. Scripts can use registers as a method of
retrieving user input.
register1
'register variable 1
…
'register2, register3
register4
'register variable 4
The following example demonstrates this by creating a script that will turn Remote Relay 1
ON
if
register1 equals 1 and
OFF
otherwise.
Xytronix Research & Design, Inc.
Page 81
Summary of Contents for WebRelay Wireless XW-210I
Page 1: ......