X-600M Users Manual Appendix H: Custom Web Pages
Function Code Description
0 Success
1 No Response
2 Login Error
3 Commit Changes Error
4 Database Error
5 Missing Parameter
The previous example showed some of the functionality given by the X-600M JavaScript library. The
following table contains a list of all the classes and functions found in the library. More examples can be
found on the X-600M device under the System > Custom Web Pages menu tab.
Class Function Description
io set(name,val,callback) Set the io with name to val and return the result to
the function callback
pulse(name,val,callback) Pulse the io with name for val seconds and return
the result to the function callback
toggle(name,callback) Toggle the io with name and return the result to
the function callback
update(id, desc,callback) Update the description of an I/O with the specified
id.
Note: Settings must be committed for this change
to take effect. See db.commitSettings() below.
reg set(name,val,callback) Set the register with name to val and return the
result to the function callback
pulse(name,val,callback) Pulse the register with name for val seconds and
return the result to the function callback
toggle(name,callback) Toggle the register with name and return the result
to the function callback
setInitVal(name,val,callback) Set the initial value of the register with name to val
and return the result to the function callback.
Note: Settings must be committed for this change
to take effect. See db.commitSettings() below.
act add(name, luaExpr, desc,
eventSourceID, callback)
Add a new action to the settings.
name – name of action
luaExpr – the lua expression to evaluate
desc – description of the action
eventSourceID – id of condtional or calendar
event that will trigger this action
callback – javascript function that will be called
with result of this function call
Xytronix Research & Design, Inc. Page 145