123
Senior Member
File Name: Manual: Premise Scripting Reference
File Submitter: 123
File Submitted: 30 Apr 2009
File Category: Premise
Author: Premise Systems
Contact: ?
Version: 1
The attached Word document contains material excerpted from Premise's online help and reformatted into a convenient, easy-to-read manual. It describes all of Premise's core objects, their methods, and examples of how to use them. Here's a sample of the System object's AddTimer method:
SYSTEM OBJECT
addTimer Creates a Timer that executes an expression at a specified interval, a specified number of times.
ADDTIMER METHOD
Creates a Timer that executes an expression at a specified interval, a specified number of times.
object.addTimer(delay, expression, repetitions, [name])
ARGUMENTS
REMARKS
You can use the addTimer method to add any repeated event. For example, you can use addTimer to execute a script 30 seconds from now to flicker a light on and off. Use addEvent for one time events. If the script expression needs to contain quotes such as, this.Description = "Hallway Light", use single quotes within the double quotes. Note: Timers should not be named with sys paths such as: sys://Schema/Modules/Default/Timers/MyTimer.
REQUIREMENTS
Version 2.0
SEE ALSO
addEvent Method | removeTimer Method | Timers
Click here to download this file
File Submitter: 123
File Submitted: 30 Apr 2009
File Category: Premise
Author: Premise Systems
Contact: ?
Version: 1
The attached Word document contains material excerpted from Premise's online help and reformatted into a convenient, easy-to-read manual. It describes all of Premise's core objects, their methods, and examples of how to use them. Here's a sample of the System object's AddTimer method:
SYSTEM OBJECT
addTimer Creates a Timer that executes an expression at a specified interval, a specified number of times.
ADDTIMER METHOD
Creates a Timer that executes an expression at a specified interval, a specified number of times.
object.addTimer(delay, expression, repetitions, [name])
ARGUMENTS
- object (optional)
Always the System Object. - Delay (required)
Time period (in seconds) from the creation of the Timer and the first Trigger, then for subsequent triggers. - Expression (required)
A valid string script expression. - Repetitions (required)
Number of times the Timer will fire. - Name (optional)
The name used to create the timer object in Modules.Default.Timers.
Code:
'Add a named event to turn off this device 10 minutes from now
system.addTimer 600, "this.PowerState = False", 1, this.Name
You can use the addTimer method to add any repeated event. For example, you can use addTimer to execute a script 30 seconds from now to flicker a light on and off. Use addEvent for one time events. If the script expression needs to contain quotes such as, this.Description = "Hallway Light", use single quotes within the double quotes. Note: Timers should not be named with sys paths such as: sys://Schema/Modules/Default/Timers/MyTimer.
REQUIREMENTS
Version 2.0
SEE ALSO
addEvent Method | removeTimer Method | Timers
Click here to download this file