User guide
Composer Pro User Guide
Copyright © 2011 Control4. All Rights Reserved.
Saved: 4/14/2011 4:10:00 PM
200-00005 Composer Pro
User Guide Part 2
Page 100 of 179
See “Programming with a While Statement” or “Programming with Conditionals” for details.
5.5.2.2 Programming with a While Statement
A ‘While’ statement runs continuously in a loop until the evaluation is shown to be False (Boolean
value). While statements can be repeating ‘if’ statements also.
To program a While statement, follow this example:
1. Start Composer and connect to a Director.
2. Click System Design.
3. Ensure that you have the following devices in your project:
• Controller
• Door Contact Sensor
• Theater Dimmers
4. Click Connections.
5. Make sure the devices are connected to the correct Relay port.
6. Click the Control/AV tab. Select Door Contact Sensor in the project tree, and ensure it is
connected to Contact Sensor in the Control & Audio Video Connections pane.
7. Click the Network tab, and ensure that the Controller and Bedroom Dimmer have an address.
8. Click Programming.
9. Before programming the ‘While’ statement, program a way to turn off the ‘While’ statement by
doing the following (when the door closes, the Bedroom Dimmer turns off):
a. Click Programming, and choose Door Contact Sensor to trigger an event in the Door
Contact Sensor Events pane.
b. Choose the When the Door Contact Sensor closes event. The selected event appears at
the top of the Script pane.










