Crestron Programming

Jeff P
14 min readOct 7, 2024

--

Part 1

As I’m working with a lot of Crestron products as the moment, I wanted to get more up-to speed with the various Crestron tools and programming languages used to make their touch panels work.

SIMPL Windows

SIMPL is a programming language for crestron touch panels. It’s getting on a bit now, and more programmers are switching to SIMPL# with CH5 front-ends, but SIMPL is still great to learn especially if you’re new to crestron programming.

With SIMPL Windows, editable source code will have the extension .smw

When you transfer a “packaged” zip file from one person to another, it will usually contain all of the necessary files related to the project:

.lpz files are the files uploaded to crestron processors such as an RMC4 or a CP4N

Crestron CP4N

You can upload the .lpz file by selecting the control processor from Crestron toolbox, and then selecting the program button:

When dealing with the touch panel front-end, the project is created in Vision Tools Pro-E

When you compile a .vtp file and a .vta (custom smart graphics theme) you will get a compiled .vtz file.

It is the .vtz file that is sent to the touch panel.

Getting Started with SIMPL

Whilst you don’t need a touch panel to practice with SIMPL, you will need either a Crestron Processor, or access to a “virtual” VC4 server. You can try this out for free for 90 days, however I’d still recommend getting hold of a cheap processor from eBay to get started.

I purchased a cheap RMC3 from eBay for £70 (September 2024) and there are plent you can purchase for under £100.

If you can stretch to it, it’s possibly worth purchasing the newer RMC4, which will future-proof yourself for at least another 3–4 years. They can be picked up usually for around the £250 mark.

Crestron RMC4 processor

These devices work with POE, so it’s worth getting a cheap POE switch if you don’t have one. This is the one I have connected to my Virgin Media broadband router:

https://www.amazon.co.uk/YuanLey-Gigabit-802-3af-Fanless-Unmanaged/dp/B082KM3PWY

Unfortunately as it was a second-hand device, it had already been partly configured, and someone had set a static IP address on it, which wasn’t in the 109.168.0.x range that all my home devices were on, so in order to get it working, I needed to connect a laptop and the RMC3 into the POE switch (nothing else connected) and then launch Crestron Toolbox (https://www.crestron.com/Products/Control-Hardware-Software/Software/Development-Software/SW-TB) and then run the device discovery tool, to find the device. I could then double click on the device and set the device to an IP address on my 192.168.0.x range.

The first thing I wanted to do was create a basic program, and then run the program on Creston “XPANEL” which is basically a virtual touch panel on your computer to emulate a real Crestron touch panel.

This is the basic program I created, and I will talk you through the steps I went through myself to get it working. Credit goes to “Over Worked Logic” on YouTube for getting me started here!

In order to create this, I needed to install both SIMPL and VT Pro-e on my computer. I started with the backend first in SIMPL I downloaded all of the following from the Crestron website:

once installed, I launched SIMPL, and this is what you are presented with:

If you want to create a new program, go to file → new program, or click on the icon along the top for new program. You’ll be asked to proved some program header information for your new program:

It’s important that you give you program a “Program ID tag” — here I gave it the same name as my system name, which was simply “my_new_program”. I also selected the RMC3 as my processor.

Once you click ok, the page will load up a system view which includes a visualisation of the RM3.

The first thing to do, would be to associate an xpanel (virtual touch panel) to my RMC3, so I expand the device, and select “Slot 2” which is the Ethernet slot (Note: slot 1 is Crestron’s proprietary “cresnet” port”.

I can then right-click on the first IP ID empty slot (ID 03) and select “add device”

Here I can select XPanel:

We can now switch to “program” view, to actually start programming:

If I open up the RMC3 folder, then open slot 2 and then double click on the XPanel, i’ll see the detailed view appear for the xpanel.

There are three different types of symbols that you can use in SIMPL:

Digital, Analog and Serial

They are represented by these three buttons:

Digital is blue, analog is red, and serial is black. This reflects the touch panel button types we’ll go on to make shortly:

symbols == objects

In SIMPL, objects are called symbols. Each symbol has a specific set of operations that it performs. The lines that connect symbols are called signals.

There are two types:

device symbols and logic symbols.

Device symbols represent Crestron hardware control.

Logic symbols determine HOW the program performs its functions and operations.

All symbols share three basic properties: inputs, outputs, and parameters

Some symbols have a fixed number of inputs. Other symbols can have a variable number of inputs as determined by the programmer based on the programming design.

In general, a symbol has one purpose: modify the states of its outputs.

Both Device and Logic Symbols may require parameter values where applicable.

valid parameters:

  • (d)ecimal
  • (h)exadecimal
  • (%) percentage of 65535
  • (s)econds
  • (t)icks — 1 tick = 1/100 seconds (2-Series); or 1/112.5 seconds (X-Series)
  • (‘)character(‘) (single byte)

Signals

There are three signal types:

Digital signals are binary in nature:

on/off

1/0

true/false

An event is when the signal changes state, i.e. goes from off to on.

Analog signals are represented with 16-bit numbers and can have values between 0 and 65535

Serial signals are text strings

You can see in the following image, the input and output digital signals for the xpanel. You know they are digital as the lines are coloured blue, and the blue digital but is selected:

Let’s create a couple of digital buttons on our xpanel, and then we can see what they do. Well create “button_1” and “button_2” which will do something when we press them.

So now we have two digital signals. Lets create some code so that if we press either of these two buttons, then BOTH of them will toggle between on and off at the same time. They will basically copy each other. But we have to also instruct the code that when we click on a button it stays clicked, rather than us clicking on it, and as soon as we let go, the button is depressed. What we want is to click the button, and it stays down, and only pops up again when we click it again. This is known as a button TOGGLE.

So we need to incorporate this toggle functionality into our buttons. In order for us to do this, let’s add in a logic symbol into our code for TOGGLE.

We firstly need to add the toggle logic symbole into our program. We can find it in the list of logic symbols on the left, and then drag the symbol into our “Logic” folder.

if we now double-click on the toggle logic symbol, we’ll see it open:

If we go to the “Help” menu, and then open “Local Help Topics” we can take a closer look at what this particular logic symbol does and how it works. The toggle logic symbol is a memory-based symbol, so it’s found in the memory section:

In order for this logic symbol to work as expected, it requires one mandatory input signal (clock) and also has two optional input signals (set and reset) — It also requires a digital output.

When I first read about the “toggle” logic symbol, the label of “clock” confused me, as I thinking about clocking or timing-related use-cases, but now that I understand it better, the clock input essentially just toggles between the “set” option, and the “reset” option, which is to set the state high (on) or low (off) — Each time the “clock” input is issued, it will just toggle to set, then reset, then set, then reset, and so on.

So going back to our programming code, if we want a button to stay “on” when we click it, rather than it just instantly turning back off as soon as we take our finger off the button, then we need the toggle logic to hold that state, until we press the button once more to turn it back off.

So let’s feed our “button_1” press into the toggle, into the mandatory “clock” input.

Ok so memory is now aware that the button is switched on. But we’d still like to give the user some actual visual feedback that the button is on now right? After all, when I click a button and it’s meant to stay on, I’d kind of like to see the visual look of that button change, such as the colour changes to a different colour, or the text changes, or it simply just looks like the button is pushed down.

In order to do this, we need to provide feedback to the XPANEL to show a visual change of the button. We’ll do this by creating a signal on the output side of the toggle, called “feedback_1”

and now so actually see this feedback, we’ll pass that back to button_1, which is the button we want to change visually when we click on it….

Before we go any further, let’s create a basic button in Vision Tools Pro-e (often referred to simply as VT Pro-e) on the front-end to actually demonstrate this. We can also then play around with this button to see what happens with it.

We’ll launch VT Pro-e and this is what we see…..

Let’s start a new project:

We’ll call the project “button_test” with the panel type set to XPANEL

NExt we’ll right-click on our “button-test” project in the left column, and select “New Page”

Note that XPANEL has fixed dimensions of 800px by 600px

We now have a blank page canvas to work with….

ok so let’s try and make the toggle button that we create the logic for in simpl windows….

We’ll add a button to the page from the menu. It’s the icon with the small triangle in it that looks a bit like a play button…

Note that you could also select the button option from the “draw” menu at the top as well if preferred….

with the button option selected, we can now drag out a button on the page to the size we want….

Now at the moment, the button won’t do anything, because we haven’t associated it with our code. In order to do this, we need to assign the button a join number….. if we look back quickly at our SIMPL windows logi code, we can see what join number we need to use….

we used the “press1” digial signal in our code, so we need to associate our button with this signal, so we join it to digital signal 1

By default you’ll be looking at the button in it’s inactive state, which basically means it hasn’t been clicked on.

If you want to see what the button will look like in it’s “active” state, which is when it’s clicked, you can select “active state” from the propery window….

So as you can see the button is now pressed down. Let’s also change the appearance of the button so that the button turns red when it’s in its active state…..

at the moment, the button just has a generic label…. let’s change the label on both the inactive state and the active state, so that it reads “OFF” for inactive state, and “ON” for active state…..

Ok now we have a button, and we’ve given it a digital join number of 1, we’re ready to try this out.

First of all, let’s head back to our SIMPL windows code. We’ll hit the F12 button to compile our code….

The program gives us a warning regarding button_2

It says “signal button_2 has no destination” — So basically it’s not going anywhere in our logic flow, and therefore won’t do anything. This won’t stop us compiling our code, but you can remove button_2 if you want to.

We can now click Yes to transfer our program….

A box will then appear….

If you’re using an older RMC3, then you’ll only have one program slot…. if you’re using a newer 4-series processor such as the RMC4, then you’ll have 10 programming slots to choose from.

You now want to select the program you wish to send from the “Send Program” drop-down, and then click the Send button.

It will then start sending your program to the processor….

If we now switch back to Vision Tools Pro-e, we can compile our program, and then point it to our processor. Once again, hit F12 to compile…

You should now have a folder with a compiled project in an xweb folder…..

However this will not work if you try to open it! Let’s see what happens if we try to open the html file in this folder….

This is because this version of XPANEL is very old! It was designed for Internet Explorer, which no longer exists! It doesn’t work with Edge, or Chrome, or Firefox for that matter!

So we have two options here….

The first is to actually compile the project as an “executable” file…. let’s try that first…..

We’ll right click on our project and go to properties….

then in the “compile” tab, we’ll change our target from “Broswer” to “Executable — PC”

Click ok, and now recompile with F12….

Now you’ll see that as well as an xweb folder, we also now have an exe folder…

In this folder, we’ll have an executable to launch xpanel

we can double click on it to launch our executable program….

So we can see the button we created in the executable, but we can also see an error message. This means our XPANEL front-end doesn’t know where to look for the processor….. let’s go to Options, Settings…

We now need to provide the IP address of our RMC3.

So we can see in my case, it’s 192.168.80 so I’ll add this address to the XPANEL settings:

and once we’ve done that, we now have a clickable button!

We actually created this button using “Classic graphics” tools, which are actually unsupported on most modern touch panels…..

This is why you’ll usually find all these buttons greyed out for most projects.

In order to use more up-to-date graphics tools in VT Pro-e, we need to utilize “smart graphics” and we’ll cover this in part 2.

--

--

Jeff P
Jeff P

Written by Jeff P

I tend to write about anything I find interesting. There’s not much more to it than that really :-)