Crestron
SIMPL+
Software
program by clicking on the compile toolbar button or selecting
Project |
Convert/Compile
. The compile process automatically recognizes that there is a
SIMPL+ module in the program and compiles it along with the SIMPL code (even
though it was already compiled when it was saved; SIMPL Windows always
recompiles because it must link the modules together with the SIMPL Windows
program).
After compilation, transfer the program when prompted by SIMPL Windows. Click
YES
and the SIMPL code section is sent first (followed by the save permanent
memory image). Once completed, the SIMPL+ program code is sent. The SIMPL+
code resides in a separate area of memory, thus it is transferred in a separate step.
Also realize that the SIMPL+ program is written directly to flash memory, thus there
is no need to create a permanent memory image.
At this point a program has been loaded into the control system and is ready to be
tested. Start
Test Manager
, and select
Status Window | Add Signal
. A list of all the
signals defined in the program appears. Click on the “test_me” signal and then click
the
Add
button. Then select
Close
. An icon representing the signal in the status
window appears.
The program is ready to be tested. Make sure that the section of
Test Manager
labeled
Incoming Data
is visible in the left-most pane. Click on the “test_me” icon
in the status window and then on the
Assert
button on the toolbar (or select
Status
Window | Assert Signals
). The signal is driven to the high state, which triggers the
push event. In the
Incoming Data
window, the string “Hello world!” appears.
Click on the
De-Assert
button to drive the signal low and trigger the release event.
In the
Incoming Data
window, the string “Goodbye cruel world!” appears.
By clicking on the
Positive Pulse
button, both strings appear one after the other,
since the push and release events are triggered in rapid succession.
Finally, what happened to the startup text “I am born”? Remember that Function
Main only runs on system startup and this occurred even before
Test Manager was
started. Thus it was missed. To see it now, reboot the control processor by selecting
Options | Reset Rack
.
In addition to the latest revision of the SIMPL+ Language Reference Guide (Doc.
5797), continue reading through this manual to learn more about how to program in
SIMPL+.
The Structure of a
SIMPL+
Program
What are the different elements that make up a SIMPL+ program? This section
provides an overview of the code structure, given in the typical order that they are
used.
Compiler Directives
Compiler directives should come at the beginning of the program, and are used to
provide explicit instructions to the compiler. As such, these elements are not part of
the SIMPL+ language itself. These directives are distinguished from actual SIMPL+
code by preceding them with a pound sign (#).
Currently there are seven compiler directives, each of which is provided in the
template file that is created when a new program is started. The compiler directives
are as follows.
Programming Guide – DOC. 5789A
SIMPL+
•
5