EasyManua.ls Logo

Crestron SIMPL+ - SIMPL+ Program Structure; SIMPL+ Program Structure Overview

Crestron SIMPL+
374 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Software Crestron SIMPL+
®
276 z SIMPL+
®
Language Reference Guide - DOC. 5797G
Program Structure
When a new SIMPL+ program is created, a template is provided that lists the order
in which constructs and statements should be defined. Sections can be uncommented
and expanded out to implement the desired code.
A SIMPL+ program layout would consist of, in order:
1. Compiler Directives
2. Input/Output definitions From/To a SIMPL Program
3. Global declarations for the module, including STRING, INTEGER,
arrays, structures, etc.
4. FUNCTION declarations
5. PUSH/RELEASE/CHANGE statements
6. FUNCTION MAIN
Forward references are not allowed in a SIMPL+ program. This means you cannot
CALL a function before it has been defined. This is the reason FUNCTION
declarations are placed before other code. If function A calls function B, then
function B should be located first in the source file.
FUNCTION MAIN is a special case function. It is not required, but any code present
between the { and } is executed at startup. This is typically used for initialization
purposes.
Example:
FUNCTION MAIN()
{
MyVar=0;
For(I=1 to 10)
B[I] = I;
}
Sometimes function MAIN() contains an endless loop with a DELAY statement that
executes periodically while the program runs.
NOTE: All of these are not mandatory and may be left out as needed.
NOTE: In SIMPL+ Version 3.00, local variables are allowed.

Table of Contents