Crestron SIMPL Windows Primer
This document was prepared and written by the Technical Documentation department at: Crestron Electronics, Inc. 15 Volvo Drive Rockleigh, NJ 07647 1-888-CRESTRON All brand names, product names and trademarks are the property of their respective owners. © 2003 Crestron Electronics, Inc.
Crestron SIMPL Windows Software Contents CRESTRON SIMPL WINDOWS.................................................................................. 1 Overview...................................................................................................................................1 About this Primer.......................................................................................................................1 Crestron Development Software .....................................................
Software Crestron SIMPL Windows Serial Signals ...........................................................................................................................18 Special Signals ‘0’ and ‘1’.......................................................................................................19 Logic Waves and Logic Solutions ...........................................................................................19 Programming with User Interfaces...............................................
Crestron SIMPL Windows Software Time-based Logic...................................................................................................................52 One Shot Family ......................................................................................................................52 One Shot ..................................................................................................................................52 Multiple One Shot................................................
Crestron SIMPL Windows Software Crestron SIMPL Windows Overview About this Primer The intent of this primer is to introduce programmers to SIMPL Windows programming techniques and how they apply to Crestron control systems. This includes an understanding of how control systems use touchpanels and button panels as user interfaces. Through these interfaces, a user might send a signal that is processed by the control system (manipulated by logic symbols) and outputted to eventually control a device.
Software Crestron SIMPL Windows Crestron Development Software SIMPL Windows Crestron SIMPL Windows provides all the tools necessary to configure, program, test and debug an integrated control system application. Combining the familiar drag-and-drop functionality of Microsoft Windows with the programming power of SIMPL (Symbol Intensive Master Programming Language), SIMPL Windows provides the link between Crestron systems hardware, user interfaces, and the world of equipment to be controlled.
Crestron SIMPL Windows Software Media Manager™ System Builder™ The Media Manager™ System Builder™ offers automatic programming for such residential and commercial applications as audio distribution, home theater, and video conferencing. The System Builder provides a Wizard-like interface that takes you through a series of programming screens. Simply follow the prompts to select the control system, user interfaces, devices and functionality.
Software Crestron SIMPL Windows You can access the Crestron Web site directly from the SIMPL Windows Online Support menu. Click Crestron Online for the Crestron home page, or click Crestron Design Center to open the Dealer/Tech Resources page. The Crestron Product Catalog and Technical Reference CD is another valuable tool that you can use in conjunction with the Crestron Web site, or any time you're not connected to the Internet.
Crestron SIMPL Windows Software Crestron Control Systems Why Program Control Systems? The term program refers to the instructions loaded into the control processor that cause it to operate in an intended way. For example, to control a DVD player, you must write a program that tells the control system which port the unit is connected to, what IR codes to send to it, and which buttons on a touchpanel trigger those functions.
Software Crestron SIMPL Windows signals, and 2048 user-defined analog/serial signals. The processor also provides 256K of NVRAM that is divided in different ways depending on the type of Ethernet card being used. “Legacy” control processors such as the ST-CP and CN-Series processors allow a total of 4085 user-defined digital signals and 512 analog/serial user-defined signals.
Crestron SIMPL Windows Software Touchpanels Crestron touchpanels are the most common user interface of any control system. Touchpanels are available in Cresnet, Ethernet, and wireless versions with either gray scale or color displays. Programmers develop touchpanel screen layouts with VisionTools Pro-e software. Buttons are assigned numbers that link them to the specific operation that it represents in the SIMPL Windows program.
Software Crestron SIMPL Windows direct control of motors and lighting circuits. In addition, relays can either be mechanical or solid-state. If you are unsure about what type of relay is needed for a given application, you can call Crestron technical support for assistance. Serial Communications Many devices today can be controlled using various types of serial communication.
Crestron SIMPL Windows Software control system to the IR receiver on the controlled device. Care must be taken to ensure that the IR emitter on the IR probe is properly located next to the receiver. Remote IR Equipment Manufacturers do not normally publish the exact nature of the data that is being sent via their IR remote controls. Therefore in order to generate the proper signal out of the Crestron IR card, the remote must be learned through the use of a special device called an IR Learner.
Software Crestron SIMPL Windows Crestron Database As described earlier, the Crestron Database contains hundreds of pre-coded IR driver files for programmers to utilize. This database covers most of the IR controlled devices on the market today. In fact, the database supports all current control formats, including relay control, analog voltages, and TCP/IP. Programmers can search the database by manufacturer or device type.
Crestron SIMPL Windows Software Because of the absence of a driver file, RS-232 control is generally considered more difficult to program than IR or custom serial. This is because each time an RS-232 device is to be programmed, the programmer must look up the protocol in the manual, and then write the necessary logic into his program to send this data. To counter this, many devices have dedicated modules written for them.
Software Crestron SIMPL Windows which sometimes find their way into control system applications, use MIDI control. From a programmer’s viewpoint, MIDI does not differ from RS-232, RS-422, or RS485. From a hardware standpoint, the CNX-MIDI card is required to generate the proper control signals. Crestron MIDI Equipment CNX-MIDI The CNX-MIDI interface card is a MIDI IN, OUT and THRU interface. It is used with mixers and lighting equipment.
Crestron SIMPL Windows Software Cresnet - Network Interconnect Specifications CAUTION: POSSIBLE EQUIPMENT DAMAGE IF MISWIRED. Do not power up system until all wiring is verified. Care should be taken to ensure data (Y, Z) and power (24, G) connections are not crossed. Ground shield at control system end only. Model CNTBLOCK network terminal block is recommended for testing purposes and convenience of wiring. Primer – DOC.
Crestron SIMPL Windows Software SIMPL Windows Programming Introduction to SIMPL Crestron engineers are dedicated to the development of our products and the interface with other manufacturer’s equipment. However, control systems need individual programming in order to be customized for each installation. Crestron control systems are programmed using SIMPL (Symbol Intensive Master Programming Language).
Software Crestron SIMPL Windows symbols to be connected, but not added or deleted. Device symbols are located in the Device Library of the Configuration Manager. Logic Symbols While device symbols allow you to communicate with the outside world, logic symbols allow you to make your program perform exactly the way you want. Logic symbols can range from the very basic ones such as the AND, OR, or NOT symbols, to those designed for very special applications.
Crestron SIMPL Windows Software For convenience, parameters may be expressed in a variety of formats (all of which are directly related to one another). Although a parameter will default to one format based upon the symbol type, you can alter the format by changing the format specifier at the end of the value. Listed below are the valid formats, where the character in parentheses represents the format identifier.
Software Crestron SIMPL Windows has an analog output, then the signal connected there will by definition become an analog signal. The three signal types are defined in more detail below: Digital Signals Digital signals are the most common in the SIMPL language, and a typical program will be comprised of between 95% and 100% digital signals. This type of signal can have only two states, often referred to as on/off. Other common descriptors are high/low, active/inactive, or 1/0.
Crestron SIMPL Windows Software Example Signal Colors Some signals are ambiguous, meaning that the signal type is determined by the driving source. For example, the inputs and outputs of a Serial Buffer symbol can be either serial or analog. The ambiguous signal is resolved when the signal is connected to an analog or serial symbol. Ambiguous signals should be resolved before the program is finalized; otherwise a compiler error will be generated.
Software Crestron SIMPL Windows Programming with User Interfaces The heart of any well-designed control system is the user-interface. This is the link between the end-user and the control system itself. Regardless of how cleverly programmed, or technically savvy a given system is, if it lacks a quality userinterface it is unlikely that the system will be appreciated, or used to its full potential.
Crestron SIMPL Windows Software Button Feedback User-interfaces that support 2-way communication (any interface except for 1-way wireless transmitters) also support button feedback. This term is used to describe the button's active appearance. For button panels, feedback is usually indicated with a LED located inside the button housing. For touchpanels, feedback can vary, and often includes changing the frame and text color, along with a simulated 3D appearance.
Software Crestron SIMPL Windows Certain buttons may call for more complex feedback. For example, a volume mute button may alternately turn the mute on and off. To indicate this with feedback, the button should display in the feedback state when the mute function is on, and turn off when mute turns off. Clearly, momentary feedback will not do the trick here, so we must use logic symbols to generate the desired behavior. This example shows how to do this using the Toggle symbol.
Crestron SIMPL Windows Software appear on top of a standard page at any time and then disappear when no longer needed, similar to a dialog box in Windows or Macintosh computers. In order to make the implementation of subpages as flexible as possible, they are controlled (i.e. shown or hidden) via touchpanel feedback signals. That is, whenever a subpage is needed, a subpage reference is created at the exact location where it is to appear.
Software Crestron SIMPL Windows Building a Program with SIMPL Windows Programming Process Identify the equipment that is going to be controlled. Programmers should prepare documentation that lists all the equipment that is to be controlled. Determine how the equipment is going to be controlled. Knowing how the various pieces of equipment are going to be controlled is very important.
Crestron SIMPL Windows Software • Select user devices made by third-party manufacturers. These are usually the devices being controlled and can include CD players, DVD players, TVs and any other equipment the end user interfaces with using the control system. • Configure the devices by specifying which units are connected to which control cards or network modules.
Software Crestron SIMPL Windows Control Systems The first step in building a system with SIMPL Windows is to select the control processor. The Device Library includes all current Cresnet and Ethernet control systems, including 2-Series, QM, and X-Series models. You can quickly add a control system by double-clicking the empty folder that is displayed in the lower System View and selecting the control system from the list. You can also the drag the control system to either of the System Views.
Crestron SIMPL Windows Software Another method is to right-click the control system in the Device Library and choose Add Device to System from the submenu. Network Hardware Once you add the control system, the next step is to add the other devices that comprise the system, including network control modules, touchpanels and other interfaces, additional plug-in cards, and user devices from the Crestron Databases.
Software Crestron SIMPL Windows If you add a Crestron device to a control card slot, SIMPL Windows will auto-assign the network address, first by the default factory ID and then sequentially. To add a Crestron device to a specific network address expand the slot and doubleclick the network address. This will open the device selection list and add the device to the selected ID. Another way to open the device selection list is to right-click the slot or network address and select Add item from the submenu.
Crestron SIMPL Windows Software Serial Devices Crestron processors control serial devices using physical standards such as RS-232, RS-422, and RS-485. Unlike IR, RS-232 control does not use ready-to-go driver files. Instead, the data format, or protocol, that the device is expecting will be provided by the manufacturer in the unit's documentation. Most Crestron control systems provide built-in COM cards and IR cards that enable 1-way and 2-way serial control.
Software Crestron SIMPL Windows To hide unused slots from the tree view, right-click any item in the tree and select Hide Unused from the submenu. This will make only the connected network addresses visible and simplify the tree view. Network IDs A Network ID is a two-digit hexadecimal value that uniquely identifies each Crestron device on the control system network.
Crestron SIMPL Windows Software View, as well as in the title bar of the device's symbol. The device name and location will be included in the Device by Location report. It's a good idea to provide descriptive names and specific locations for all network devices, as this can aid in debugging. Devices that draw power from the Cresnet network will also display the power consumption in watts. Net ID: You can change the Cresnet ID of the device by selecting from the list.
Software Crestron SIMPL Windows Device Info: This tab provides "read-only" program information about each device. Ethernet Devices IP Net Address: You can change the IP ID of an Ethernet device or Ethernet remote processor by selecting from the list. In addition to the IP ID, you have to assign a unique IP address. If the device or remote processor has a static IP address, click Use IP Address and enter the IP address in the text fields.
Crestron SIMPL Windows Software Serial Devices Serial Settings: Set the device's serial protocol according to the manufacturer's specification. The protocol you set here includes the communication standard (e.g., RS-232), the speed of data transmission (baud rate), error checking (parity), the number of data bits, and the number of stop bits. In addition, a given device may require hardware (RTS/CTS) or software (XON/XOFF) handshaking, which controls the flow of data between two devices.
Software Crestron SIMPL Windows 04. The chained device will share the master device's definition, and it will be displayed in the top System View as a Chained icon. The Chain Master panel will automatically display the Net IDs of all touchpanels that have been chained to it. In the following example, the Chain Master has two chained touchpanels located at Net IDs 03 and 05. As indicated below, the chained panel will lose any signals that were previously defined.
Crestron SIMPL Windows Software The button press is the end user’s request for a specific action; therefore, the output signals of the user interface have to be named, or “defined”. This way, each signal can be identified and routed properly. To program a user interface, locate it in Program View by expanding the appropriate slot or folder. Then drag the interface to Detail View or double-click it. This will display the touchpanel definition in Detail View.
Software Crestron SIMPL Windows Entering Signal Name Using Logic Symbols Programmers will typically use many symbols when programming in SIMPL Windows. Logic symbols allow programmers independent flexibility by offering many different ways to solve a control problem. Logic symbols can range from the very basic ones such as the AND, OR, or NOT symbols, to symbols designed for very special applications.
Crestron SIMPL Windows Software Programming with Logic Symbols Introduction In the last chapter we saw how a program could be written simply using device symbols and connecting them via signals. This type of program uses "direct functionality." That is, button presses (or any other type of system input) are connected directly to control functions, such as the PLAY command on an IR driver. When the button is pressed, the PLAY command is sent out the IR port, and it stops as soon as the button is released.
Software Crestron SIMPL Windows Program Formatting – Symbols that help to organize and arrange program information. Sequencing Operations – Symbols that assert outputs according to a sequence. Serial – Symbols that generate, parse, and process serial string data. System Control – Symbols that affect the logic processor and allow it to communicate with remote systems and send data directly to the console.
Crestron SIMPL Windows Software NOT Symbol Example: Automatic Camera Control Sometimes a device provides the opposite signal than you want. For example, say your control system is set up to receive contact closures from an automatic microphone mixer, indicating which microphone has just been spoken into. In a video conferencing application, these closures might be used to point the camera directly at the speaker.
Software Crestron SIMPL Windows OR Symbol Example AND Symbol The AND symbol will drive its output signal high whenever all of its inputs are high. Looking at the figure below, you could say that 'signal_out' is high whenever 'signal_1_in' AND 'signal_2_in' are high. AND Symbol Alternatively, we can describe the behavior of the AND symbol using the truth table shown below.
Crestron SIMPL Windows Software use of a current sensing device, we have generated a digital signal that represents whether a VCR is currently turned on or not. That is, when the signal ‘vcr_is_on’ is high, the VCR is on. Using AND symbols, we can ensure that when the VCR is on, and the ‘vcr_power_off’ button is pressed, we send the power command to the VCR. If the VCR is off and the ‘power_off’ button is pressed, we do not want to send the power command because this would cause the VCR to turn on.
Software Crestron SIMPL Windows BUFFER Symbol- High/Low This symbol differs from the other symbols discussed to this point in that not only does it allows an arbitrary number of inputs (in addition to the enable), but each input has a corresponding output. This is unlike the NOT, OR, and AND symbols, which have just a single output. Realize that the each input/output pair in the Buffer is independent of the other input/output pairs.
Crestron SIMPL Windows Software Buffer Example Note from the example that only one Buffer should be enabled at any given time. If two Buffers were enabled at once, pressing the PLAY button would cause multiple commands to be issued, which is not what we want in this example. To ensure that this does not happen, we can force only one of the state signals to be high at any time. This will be covered later in this chapter.
Software Crestron SIMPL Windows The nature of the SIMPL language makes it relatively easy to cause multiple events to occur off of a single button press (or any event for that matter).
Crestron SIMPL Windows Software However there are some drawbacks to this method. First, programs written in this matter can be difficult to read, in that you must trace the signal completely to determine what events it triggers. This is made easier by the ‘Show Routings’ command in SIMPL Windows.
Software Crestron SIMPL Windows Buffer Buffer Touchpanel fb115 press115 fb116 fb117 fb118 press116 press117 press118 fb119 fb120 press119 press120 fb121 fb122 fb123 press121 press122 press123 fb124 fb125 press124 press125 System_On 1 enable in1 out1 Screen_Down System_Off in2 in3 in4 out2 out3 out4 VProj_Power_On Lights_Scene_2 Screen_Up in5 in6 out5 out6 VProj_Power_Off Lights_Scene_1 To Devices You will notice two interesting features about this example.
Crestron SIMPL Windows Software considered “level triggered” in that the current input values always determine the states of the outputs. Set/Reset Latch symbol This symbol implements the most basic memory element, also known as a set/reset flip-flop. The symbol has two possible states, referred to (oddly enough) as set and reset. When set, the signal connected to the ‘out’ terminal will be high. When reset, ‘out’ will be low.
Software Crestron SIMPL Windows Toggle Example: Volume Mute A Toggle symbol provides an easy way to implement a single-button volume mute. Shown is a mute button being connected to the ‘clock’ input. Each press of this button will cause the signal ‘Mute_On’ to alternate between logic high and low. Typically this output signal would be routed to a muting relay inside of a volume controller such as the ST-VC.
Crestron SIMPL Windows Software Toggle Example: device power on/off Touchpanel fb87 press87 fb88 fb89 press88 press89 fb90 press90 Toggle Power_On Power_Off Power_On/Off set reset clock COM Port out "PWR ON\r" out* "PWR OFF\r" CNRFHT30 A press1 press2 press3 press4 press5 press6 press7 press8 Interlock Symbol The Interlock symbol will latch an output high on the rising-edge of its corresponding input.
Software Crestron SIMPL Windows Interlock Example: source selection feedback Select_VCR_fb Select_DVD_fb Touchpanel COM Port fb15 press15 Select_DVD "IN1\r" fb16 fb17 fb18 fb19 press16 press17 press18 press19 Select_VCR Select_PC_1 Select_PC_2 Select_DSS "IN2\r" "IN3\r" "IN4\r" "IN5\r" Interlock clear set_all in1 in2 out1 out2 in3 in4 out3 out4 in5 out5 Select_DSS_fb Select_PC_2_fb Select_PC_1_fb Note that the output signals in this example are being used for feedback only, and are not
Crestron SIMPL Windows Software Interlock Example: multi-device control (part 2) - Each IR Driver symbol represents a different .
Software Crestron SIMPL Windows Time-based Logic All of the logic that we have seen up to now is strictly event-driven; when an event (a positive-edge transition, for example) occurs the symbol drives its output signals to the appropriate levels. Sometimes this is not sufficient, however, and you need to control when things will happen. The symbols discussed in this section all allow some form of control based on time.
Crestron SIMPL Windows Software custom control system you would normally want to handle this internally, thus the user can simply tap a button and the projector would turn on as expected. Shown above is a One Shot symbol that is triggered off a button press and generates a 4second output pulse to drive the IR command.
Software Crestron SIMPL Windows Retriggerable One Shot Example: automatic power down Touchpanel OR fb115 fb116 fb117 fb118 fb119 press115 press116 press117 press118 press119 i1 i2 i3 i4 i5 fb120 fb121 press120 press121 i6 i7 fb122 fb123 fb124 fb125 press122 press123 press124 press125 i8 i9 i10 Retriggerable One Shot out out out* trig trig* reset pulse_time System_Active 3.00.00.
Crestron SIMPL Windows Software simply passes all input transitions through to the output(s). Thus, you would need some elaborate logic to reset the Delay each time a button was pressed. Second, the Delay symbol is a single-precision symbol, meaning that the values of the ‘time’ parameters can only range from 0 to 583 seconds. This makes it impossible to create a 3-hour wait time.
Software Crestron SIMPL Windows Oscillator Example: blinking feedback Screen_up_fb Touchpanel fb245 fb246 Set/Reset Latch press245 press246 Screen_up Screen_down set reset out out* Exclusive OR in1 in2 One Shot trig out out reset pulse_time 15s OR in1 in2 One Shot trig reset out pulse_time 15s Oscillator out gate out hi_time 0.25s lo_time 0.
Crestron SIMPL Windows Software Analog Logic The last section introduced you to the most basic set of symbols in the SIMPL language. With a good understanding of these symbols, you can write complex and powerful programs. You might have noticed, however, that all of the symbols discussed up until now have dealt exclusively with digital signals. From our discussion in previous chapters we know that in addition to digital signals our programs can contain analog and serial signals as well.
Software Crestron SIMPL Windows Analog Ramp Example: volume control via CNXVTC-3 CNXVTC-3 Touchpanel fb437 press437 Program_vol_up fb438 fb439 fb440 press438 press439 press440 Program_vol_down an_fb10 an_fb11 an_act10 an_act11 Analog Rampaout up down mute ramp_time Speech_vol_up Speech_vol_down ramp_time 4s Analog Rampaout up down mute 4s muteA muteB muteC volA volB volC trebA trebB trebC bassA bassB bassC Analog Initialize The Analog Initialize symbol allows you to set the current state o
Crestron SIMPL Windows Software Analog Initialize – the outputs of the Decade symbol must be connected to additional logic, not shown in the example below Touchpanel fb115 fb116 press115 press116 fb117 fb118 fb119 press117 press118 press119 fb120 fb121 fb122 fb123 fb124 press120 press121 press122 press123 press124 fb125 press125 Analog Initialize Ch_preset_CBS Ch_preset_NBC Ch_preset_ABC Ch_preset_PBS Ch_preset_Comedy Ch_preset_HBO Ch_preset_HBO2 Ch_preset_HBOW Ch_preset_ESPN Ch_preset_On_Demand
Software Crestron SIMPL Windows used in conjunction with other symbols that require analog signals as inputs (e.g. Analog Sum). In this case you can simply place a "1" on the digital input, and thus on startup all output signals will be set to the values specified by the corresponding parameters.
Crestron SIMPL Windows Software Analog Preset Example: preset volume levels Analog Preset 100% 100% 100% 100% ramp_time 1s Touchpanel Analog Preset CLX-1DIM4 fb1 fb2 press1 press2 Lights_On Lights_Off 0% Downlights_Level incandescent fb3 fb4 press3 press4 Lights_Scene_1 0% 0% 0% Accents_Level incandescent incandescent incandescent Lights_Scene_2 ramp_time Chandelier_Level Sconces_Level 3s Override1 In_Override Error Analog Preset Override2 Override3 Override4 50% 10% 75% 50% ramp_
Software Crestron SIMPL Windows symbol, it is triggered by any change on the analog or serial signal connected to its "rx$" input. When a change is detected on the input, the symbol will drive its digital output "out" high for the amount of time specified in the "pulse_time" parameter. The symbol is also retriggerable in the sense that if the input signal changes again while the symbol's output is still high, the timer restarts.
Crestron SIMPL Windows Software Modules SIMPL Windows provides programmers with a number of Crestron modules as well as a predefined directory to store user created modules. Crestron modules are prepackaged logic programs. A Crestron module is a set of pre-written and debugged logic used for controlling a particular device or performing a function. The use of modules saves programming and debugging time since a large portion of the symbol – signal functionality already exists inside the module.
Software Crestron SIMPL Windows Click Communications on the Edit menu and select the connection type: RS-232. Then use the following settings to make the COM port settings of the PC match those of the control system: • Port = COM 1. Select the correct COM port on the PC (COM 1 through COM 8).
Crestron SIMPL Windows Software For a TCP/IP connection, use Ethernet straight-through cables to connect the PC and control system to the Ethernet network. TCP/IP connection Set IP Information If you intend to communicate with the control processor via Ethernet you have to configure the processor's IP information. 1. Set up an RS-232 connection to the control system, as described earlier. 2. Click Viewport on the Tools menu to start the Crestron Viewport. 3.
Software Crestron SIMPL Windows Convert/Compile Operation Information If any errors or warnings are generated during the compile operation, they will be shown in the Program Compilation list. You can click Help for further information about the error, or double-click the error to locate the signal that generated the error. For further information about compiler errors, refer to the SIMPL Windows help file.
Crestron SIMPL Windows Software Software License Agreement This License Agreement (“Agreement”) is a legal contract between you (either an individual or a single business entity) and Crestron Electronics, Inc. (“Crestron”) for software referenced in this guide, which includes computer software and, as applicable, associated media, printed materials, and “online” or electronic documentation (the “Software”).
Software Crestron SIMPL Windows If You are a business or organization, You agree that upon request from Crestron or its authorized agent, You will within thirty (30) days fully document and certify that use of any and all Software at the time of the request is in conformity with Your valid licenses from Crestron of its authorized agent. Without prejudice to any other rights, Crestron may terminate this Agreement immediately upon notice if you fail to comply with the terms and conditions of this Agreement.
Crestron SIMPL Windows Software Return and Warranty Policies Merchandise Returns / Repair Service 1. No merchandise may be returned for credit, exchange, or service without prior authorization from CRESTRON. To obtain warranty service for CRESTRON products, contact the factory and request an RMA (Return Merchandise Authorization) number. Enclose a note specifying the nature of the problem, name and phone number of contact person, RMA number, and return address. 2.
Crestron Electronics, Inc. 15 Volvo Drive Rockleigh, NJ 07647 Tel: 888.CRESTRON Fax: 201.767.7576 www.crestron.com Primer – DOC. 6253 11.03 Specifications subject to change without notice.