In Part 1 of this primer, we’re going to look at how to create a new SIMPL# Pro project. This series assumes you have a copy of Visual Studio 2008 SP1 installed as well as the Crestron SIMPL# Plug-In. If you need to install the plug-in, it can be downloaded from Crestron. The current version is 2.000.0058.01.
First, we want to create a new Project. Go to File > New > Project in the menus and you’ll see the following dialog window:

Make sure to pick Crestron for the type, select SIMPL# Pro as the template, and choose a location to save the project. We’re going to name this first one Part1. Press OK and your new project will be created.
Your new project will open with the ControlSystem.cs file opened automatically. You can scan through this file if you like, but we’re not changing any parts of it just yet.
We need to tell Visual Studio how to connect to our controller to test out this program. In the Solution Explorer window, open the ControlSystem.cfg file by double-clicking on it.

In the configuration settings, click the Address Book icon to select a control system. This is the same Address Book used by Toolbox. If you already have Toolbox open, you may run into problems with Visual Studio trying to use the same COM server.

Once you’ve selected a controller, make sure to select a Program Slot. We’ll load to Slot 1 in this example.

The Upload Project button is grayed out still because we need to build our project first. Go to the Build > Build Solution menu item or press F6. If you watch the status bar at the bottom you should see “Build succeeded” once it’s done compiling. Much faster than SIMPL Windows, right?!
Now we can press the Upload Project button on the ControlSystem.cfg page. Press the Upload button to send your program to the control system.

Once you see “Program successfully uploaded,” you may close the Upload Project dialog. If you’ve made it this far, great! Unfortunately, we don’t really know what our program is doing yet. Is it even running?
Open ControlSystem.cs and lets change a few things. I want you to remove almost everything until you’re left with only this:
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.CrestronThread;
namespace Part1
{
public class ControlSystem : CrestronControlSystem
{
public ControlSystem()
: base()
{
Thread.MaxNumberOfUserThreads = 10;
}
public override void InitializeSystem()
{
CrestronConsole.PrintLine("\n Hello world! \n");
}
}
}
When the control system starts our program, it creates a new ControlSystem
object then calls InitializeSystem
to handle the rest. After that, we rely solely on events to trigger things in our program (i.e.: button pushes, serial communication, timers, etc.). Build this program and load it to your controller.
Again, nothing happens? We can’t launch SIMPL Debugger to inspect the program because we’re not running the SIMPL engine anymore. But we can look at the console. The call we’re making to CrestronConsole.PrintLine
can be very useful to see what’s going on inside our code. Later, we’ll look into using the debugging features built into Visual Studio to inspect the running program even better. For now, PrintLine
s will work just fine. Use an SSH client (such as PuTTY) to connect to your control processor and watch what happens.

Still not much going on, right? Because right now, the only thing our program does is print out “Hello world!” when it starts (in InitializeSystem
). If we restart the program from Text Console, we can watch the message when it starts up. Use the progreset
command to restart our program:

There’s our “Hello world!” Notice that it’s printed out after the program header but before our program has fully initialized. InitializeSystem
is one of those special methods that must return quickly otherwise the controller might think our program locked up. Later on when we start reading configuration files, we’ll need to find a way to pass this off to another execution thread. That way we can still let InitializeSystem
return quickly.
Summary
In this part we learned:
- How to create a new SIMPL# Pro project
- Connect to a control system and push code
- Open a Text Console to send commands and watch for feedback
- Use
CrestronConsole.PrintLine
to debug
Nice Intro …. thank you!
LikeLiked by 1 person
Great tutorial! Thanks for posting!
LikeLiked by 1 person
Thank you so much for taking the time to post this. It was very helpful!
LikeLiked by 1 person
Thanks so much for this! As a hobbyist who just picked up an RMC3 to play around with, I find the lack of proper S#Pro tutorials frustrating. Even Crestron docs fall way short. Your quick, simple tutorial with ample pics helped clear up a lot of questions and finally showed me my used RMC3 is not braindead after all. Kudos!
LikeLike
Thank you, Troy! Crestron used to charge for the in-person S# training class, and my company wouldn’t spend the money on it. I used to dig through what information I could find, but thought it would be handy to collect some “Getting Started” material into one place I could easily find it. I’m glad you found it useful as well!
LikeLike
Thank you for taking the time to share this! Much appreciated. I’m just getting started with Simpl# and C# and while you can find a lot of information about C#, specific information about using C#/Simpl#PRO in Crestron is a closely guarded secret! Luckily, Crestron posted some training material that I also found very helpful, but a quick start like yours is a good start for many people.
LikeLike