Crestron SIMPL+ Software Programming Guide
Software Crestron SIMPL+ #SYMBOL_NAME - Allows the user to specify the name that SIMPL Windows uses for this module. If this directive is left out,
Crestron SIMPL+ Software #DEFINE_CONSTANT VCR_INPUT 3 #DEFINE_CONSTANT DVD_INPUT 4 #DEFINE_CONSTANT VPROJ_OUTPUT 2 PUSH vcr_select { switcher_inpu
Software Crestron SIMPL+ Crestron-Libraries are provided from Crestron and are contained within the Crestron Database. Variable Declarations Variabl
Crestron SIMPL+ Software variables are also available with the INTEGER and STRING datatype. Integers are 16 bit quantities. For the 2-series contr
Software Crestron SIMPL+ User-Defined Functions The term checksum byte is commonly used in serial communications to represent a byte (or bytes) that
Crestron SIMPL+ Software This example assumes that the camera unit being controlled continues to move in a given direction until a stop command is i
Software Crestron SIMPL+ CHANGE output_value PUSH button1, button2 { <statements> } A useful feature of SIMPL+ event functions is that a sing
Crestron SIMPL+ Software while (1) { <do something forever> // code in here runs // continuously } } This loop runs continuou
Software Crestron SIMPL+ Analog Inputs/Outputs Analog signals are used in SIMPL to accomplish tasks for which digital signals are inadequate. Typica
Crestron SIMPL+ Software SIMPL+ program. The value of any output is the value of the signal as seen by the outside SIMPL program at that instant. Th
This document was prepared and written by the Technical Documentation department at: Crestron Electronics, Inc. 15 Volvo Drive Rockleigh, NJ 0764
Software Crestron SIMPL+ The 'if' language construct is described in detail in “Controlling Program Flow: Branching”. Evaluation of TRUE a
Crestron SIMPL+ Software When an integer has a value of between 0 and 32767, it is identical whether it is considered signed or unsigned. However, n
Software Crestron SIMPL+ Examine one more example: INTEGER a, b, c, d; Function Main() { a = 100; b = -4; c = a / b; // c = 0 (100/65532)
Crestron SIMPL+ Software name, as was done when it was declared. When assigning a value to a string, that value is always assigned starting at the f
Software Crestron SIMPL+ Notice how the constant parts of the string are entered directly. The interesting thing about the format specification is t
Crestron SIMPL+ Software The first two examples above define 1D and 2D integer arrays, respectively. The last example looks like it declares a 2D ar
Software Crestron SIMPL+ Operators, Expressions, and Statements This section deals with the core programming elements in SIMPL+. Operators Operator
Crestron SIMPL+ Software Expressions As reading through the later parts of this guide, as well as the latest revision of the SIMPL+ Language Referen
Software Crestron SIMPL+ Branching” and “Controlling Program Flow: Loops” on pages 24 and 27, respectively. Statements Statements in SIMPL+ consist
Crestron SIMPL+ Software Expressions EXPRESSION EVALUATES TO a = 3 true if a=3, false otherwiseb*4 - a/3 true as long as the result is non-zero1 alw
Crestron SIMPL+ Software Contents SIMPL+ 1 Introduction ...
Software Crestron SIMPL+ today = getDayNum(); // gets the current day of the week if (today = 0) // is today Sunday? { // code to run on Sunda
Crestron SIMPL+ Software Examine an example using the switch-case construct. Perhaps there is a variable that should hold the number of days in the
Software Crestron SIMPL+ To see an example of the for loop use the situation alluded to above. That is, a need to clear each string element in a str
Crestron SIMPL+ Software while and do-until Loops The for loop discussed in an earlier section is useful for iterating through code a specific numbe
Software Crestron SIMPL+ this code, the value of this expression determines whether or not the code should be executed again. Here lies the other di
Crestron SIMPL+ Software programming task that has been predefined and given a name. Many of the examples in previous sections of this document have
Software Crestron SIMPL+ perform exactly like system functions with the only exception in that they must be defined before they are used. Function D
Crestron SIMPL+ Software The FUNCTION keyword is used to tell the SIMPL+ compiler that what follows is the definition of a function and not a functi
Software Crestron SIMPL+ This code causes a compile error, because the function MyUserFunction1 has been called before it has been defined. This can
Crestron SIMPL+ Software Print("i = %d, j = %d, k = %d\n", i, j, k); Call sillyFunction(); Print("i = %d, j = %d, k = %d\n"
Software Crestron SIMPL+ Wait Events ...
Software Crestron SIMPL+ localStr = left(var3, 10); } Notice that the function shown above has three arguments, named var1, var2, and var3. var1
Crestron SIMPL+ Software String1 = itoa(int1); position = find(“Artist”,CD_data); int3 = max(int1, int2); For clarity, here are some example stateme
Software Crestron SIMPL+ Print(“5 raised to the power of 3 = %d\n”,power(5,3)); x = power(y,z); As a second example, we shall build a function which
Crestron SIMPL+ Software To solve this problem, SIMPL+ has introduced the concept of function libraries. Simply put, a function library is a collect
Software Crestron SIMPL+ flash card within the control system. The function will return an error code and the program can act accordingly. Other pr
Crestron SIMPL+ Software DIGITAL_INPUT readCompactFlashCard; DIGITAL_INPUT writeCompactFlashCard; INTEGER myInt; LONG_INTEGER myLongInt; STRING myS
Software Crestron SIMPL+ } myStruct struct; PUSH writeCompactFlashCard { SIGNED_INTEGER nFileHandle; INTEGER nNumBytes; StartFileOpe
Crestron SIMPL+ Software PUSH startMe { Print("I’m starting now..."); Delay(500); //this equals 5 seconds Print("and I’m endin
Software Crestron SIMPL+ This syntax defines a wait event to occur at some time in the future, defined by the value of wait_time. While the wait eve
Crestron SIMPL+ Software Pulse(PULSETIME, vproj_on); } Wait (1500, sysOnWait2) // 15 second delay pulse(PULSETIME, vproj_video); } // end of
Crestron SIMPL+ Software SIMPL+ Introduction What is SIMPL+? SIMPL+ is a language extension to SIMPL Windows. It does not replace SIMPL, but inste
Software Crestron SIMPL+ The Serial Send symbol simply generates the static text defined in its parameter field onto the output serial signal whenev
Crestron SIMPL+ Software second pass: jukebox_in = "k=My Way, Album=Very Good Yea" third pass: jukebox_in = "rs<CR>" I
Software Crestron SIMPL+ Notice that a do-until loop was used in the example above. Every time a change event is triggered for the data_in buffer, i
Crestron SIMPL+ Software tempStr = ""; } This example introduces two new system functions, which are extremely useful for string manipul
Software Crestron SIMPL+ There are two ways to force a task switch: with the ProcessLogic function or the Delay function. To provide an immediate ta
Crestron SIMPL+ Software To determine if a run-time error is occurring in your program, watch the status of the control system's computer port
Software Crestron SIMPL+ Software License Agreement This License Agreement (“Agreement”) is a legal contract between you (either an individual or a
Crestron SIMPL+ Software If You are a business or organization, You agree that upon request from Crestron or its authorized agent, You will within t
Software Crestron SIMPL+ Return and Warranty Policies Merchandise Returns / Repair Service 1. No merchandise may be returned for credit, exchange,
Crestron SIMPL+ Software This page intentionally left blank. Programming Guide – DOC. 5789A
Software Crestron SIMPL+ Using SIMPL vs. SIMPL+ SIMPL+, while exciting and powerful, does present the programmer with somewhat of a dilemma, namely,
Crestron Electronics, Inc. Programming Guide – DOC. 5789A 15 Volvo Drive Rockleigh, NJ 07647
Crestron SIMPL+ Software Start creating a new SIMPL+ program while running SIMPL Windows. Select File | New | New SIMPL+ Module. The SIMPL+ program
Software Crestron SIMPL+ Function Main { Print( “I am born!”\n ); } This causes the text “I am born” to be sent out the computer port only upon st
Crestron SIMPL+ Software program by clicking on the compile toolbar button or selecting Project | Convert/Compile. The compile process automatically
Kommentare zu diesen Handbüchern