Specifications

Crestron SIMPL+
Software
Contents
SIMPL+
1
Introduction ...............................................................................................................................1
What is SIMPL+?........................................................................................................ 1
For Whom is this Guide Intended?..............................................................................1
Using SIMPL vs. SIMPL+.......................................................................................... 2
What is Needed to Use SIMPL+?................................................................................2
Where Can I Get More Information?...........................................................................2
Quick Start.................................................................................................................................2
Writing Your First SIMPL+ Program: “Hello world!” ...............................................2
Making it Work ...........................................................................................................4
The Structure of a SIMPL+ Program.........................................................................................5
Compiler Directives.....................................................................................................5
Include Libraries.......................................................................................................... 7
Variable Declarations ..................................................................................................8
User-Defined Functions.............................................................................................10
Event Functions.........................................................................................................10
Function Main ...........................................................................................................12
Working with Data (Variables)................................................................................................13
Input/Output Types....................................................................................................13
All About Variables...................................................................................................16
Arrays........................................................................................................................20
Operators, Expressions, and Statements ..................................................................................22
Operators ...................................................................................................................22
Expressions................................................................................................................ 23
Statements .................................................................................................................24
Controlling Program Flow: Branching .................................................................................... 24
if–else ........................................................................................................................ 24
switch–case................................................................................................................ 26
Controlling Program Flow: Loops...........................................................................................27
for Loops ...................................................................................................................27
while and do-until Loops...........................................................................................29
Exiting from Loops Early.......................................................................................... 30
Using System Functions ..........................................................................................................30
User Defined Functions ...........................................................................................................31
Function Definitions.................................................................................................. 32
Defining Local Variables In Functions......................................................................34
Passing Variables to Functions as Arguments...........................................................35
Functions That Return Values ...................................................................................36
Function Libraries ..................................................................................................... 38
Compact Flash Functions.........................................................................................................39
CheckForDisk and WaitForNewDisk........................................................................ 39
Reading and Writing Data.........................................................................................40
Working with Time..................................................................................................................42
Delay .........................................................................................................................42
Pulse ..........................................................................................................................43
Programming Guide – DOC. 5789A Contents i