Variable Declarations - Crestron SIMPL+ Programming Manual

Crestron simpl+ software: software guide
Hide thumbs Also See for SIMPL+:
Table of Contents

Advertisement

Software
The current release of
SIMPL+ does not support
passing parameters (constant
values) from the SIMPL
program into the SIMPL+
module. Look for this feature
in a future release.
For more information on the
buffer_input, refer to
"Working with Strings" on
page 45.
8 • SIMPL+
Crestron-Libraries are provided from Crestron and are contained within the Crestron
Database.

Variable Declarations

Variables can be thought of as storage areas to keep data. When writing all but the
most basic of programs, users need to use variables to store values.
Any variable used in a SIMPL+ program must be declared before it is used. This
also tells the operating system how much space must be reserved to hold the values
of these variables. This section describes the different types of variables in SIMPL+
and how to define them.
Inputs, Outputs, and Parameters
SIMPL+ programs communicate with the SIMPL program in which they are placed
through input and output variables and through parameter values. This is similar in
concept to the Define Arguments symbol used in SIMPL macros. Input variables
can be of three types: digital, analog, and string types. These correspond directly to
the same signal types in SIMPL and the buffer input, which is a special case of the
string input. Output variables can only be of the digital, analog, or string variety.
Input variables are declared using the following syntax.
DIGITAL_INPUT <dinput1>,<dinput2>,...<dinputn>;
ANALOG_INPUT <ainput1>,<ainput2>,...<ainputn>;
STRING_INPUT <sinput1>[size],<sinput2>[size],
...<sinputn>[size];
BUFFER_INPUT <binput1>[size],<binput2>[size],
...<binputn>[size];
Digital and analog output variables are declared in the same way, except the word
input is replaced with output, as follow shown below. String output variables do not
include a size value. There is no output version of the buffer variable.
DIGITAL_OUTPUT <doutput1>,<doutput2>,...<doutputn>;
ANALOG_OUTPUT <aoutput1>,<aoutput2>,...<aoutputn>;
STRING_OUTPUT <soutput1>,<soutput2>,...<soutputn>;
The inputs and outputs declared in this way govern the appearance of the SIMPL+
symbols that are presented via SIMPL Windows. The order of the signal declarations
is important only within signal types; in SIMPL Windows, digital signals always
appear at the top of the list, followed by analogs, and then serials.
Variables
In addition to the input and output variables described in the last section, the user can
define and use variables that are only seen by the SIMPL+ program. That is, the
SIMPL program, which holds this module has no knowledge of these variables. In
addition, any other SIMPL+ modules that are included in the SIMPL program would
not have access to these variables.
"Working with Data (Variables)" discusses variables in much more detail. For now,
understand how to declare them. Declaring variables tells the SIMPL+ compiler how
much memory to put aside to hold the workable data.
These variable declarations are very similar to input/output declarations. However,
instead of digital, analog, and serial (string and buffer) types, integer and string
Crestron SIMPL+
Programming Guide – DOC. 5789A

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents