Event-driven programming
Programming is based on events. When an event is triggered, other actions can take place.
Example: If you program to lower the projector screen in the Theater by pressing a keypad button. You can program the receiver, DVD player, and projector to power up and start playing a DVD also. Programming the system is where the true value of Composer Pro becomes a reality.
To program the system using Composer Pro, you drag and drop Events and Actions that you create for corresponding devices to a programming Script pane. The sections below show these panes.
Select an event (left side of the window):
Select the action(s) (right side of the window):
After you select the Event, Drag the Actions commands to the Script pane (middle pane):
The next table describes events, actions, and the script.
Programming Item |
Description |
Events |
All programming begins with events. An event is a “when” statement. An event is the trigger report that something happened that results in an automation. Events happen instantaneously. On a keypad, pushing a button is one event. Actions all occur under Events. Examples of events include:
|
Actions |
After the event identifies to the system that something occurred, it sends actions. The following are the methods that are used by the system to define actions:
Light: on, off Blu-ray player: play, stop, pause Security device: arm, disarm TV device: Power on/off, change channel
If door is open If after 5 PM If light is greater than 50 percent
While the sprinklers are on While the motion detector detects movement While a doorbell switch is being pressed Warning: Using loops (WHILE statements) can potentially overwhelm the controller’s CPU. Use loops sparingly.
|
Script |
The linking of events and actions is defined in the script. |
Tip: To configure or program devices, you can use properties, agents and variables also. These are considered advanced configuration and programming tasks. See “Using and Programming with Agents ” or “Examples: programming with variables.”