A Modern Crestron Programming Strategy
A large majority of end-users and businesses understand the pace at which technology advances in the modern world. As a Crestron Service Provider, we often have to be more pragmatic regarding the efficacy of programming strategies underlying our business processes. I would argue, that the primary goal should be to maximize value. This ensures that the decisions being made are optimized to reduce senseless changes that add little or no value to the business or your customers. Beneficial decisions will naturally follow with such a mindset.
SIMPL# Pro is one such technology that can add unparalleled value to your control system solutions. To many Crestron programmers with their adolescent knowledge of the Microsoft C# language, it seems unfamiliar and peculiar. This stems from the fact that many programmers were never required to learn C# programming in the past. Consequently, some programmers dismiss the idea entirely; a mistake that can lead to a myriad of lost opportunities. As a zealous C# programmer having an award from Microsoft on the topic, I believe I have enough credibility to suggest a case for both sides. Let’s discuss the disadvantages first, following a list of advantages.
Note: “SIMPL#” is a Crestron term for their programming solution that utilizes the Microsoft C# programming language. SIMPL# Pro allows Crestron programmers to write control system programs entirely in C#.
- SIMPL# Pro is more difficult to learn, in which the learning curve of both SIMPL Windows and SIMPL+ pales by comparison.
- SIMPL# Pro library documentation is still a work in process. (This makes many things a journey of trial and error, which can be added complexity for someone who is trying to learn the C# language at the same time. The libraries themselves also do not come without their quirks.)
- SIMPL# Libraries can be used to extend the functionality of a program written in SIMPL Windows, but not without limitations. (i.e. Types have to be “translated” to SIMPL+ compatible ones which can reduce the versatility of the underlying functionality, the SIMPL+ cross compiler contains bugs, etc.) This leads to an implied benefit in having everything encapsulated within the SIMPL# Pro environment, without having to adapt the information to comply with the limited boundaries of SIMPL+.
- You can create hardware at runtime dynamically. (In comparison to SIMPL Windows programs, where you have to hardcode the combined hardware definitions before compilation, regardless of whether you’re remapping devices or not.)
- The controller definition is entirely dynamic. What I mean, is that you can write a single program that is designed to support a DMPS of any type, or even have a program that can support a CP4 and a PRO4 simultaneously.
- C# source code allows you to utilize source control the way it was intended to be used. (SIMPL Windows files that define the symbols and signals within a program aren’t managed by the programmer directly, making diffs completely useless.)
- The C# language allows you to represent data without restricting you to a maximum of 16-bit integers. You can use primitive types that hold 64-bit values, and even use classes that can support much larger such as BigInteger. It also gives you the ability to use IEEE 754 floating point datatypes such as float and double, as well as the decimal type when you need greater precision.
- Being able to use IDE’s like Visual Studio or JetBrains Rider gives you the ability to be vastly more efficient with your workflow. These tools are used by millions of developers around the world, and are fine tuned to accommodate many different use cases and features.
- The ability to use a fully fledged CI/CD pipeline to automate build and deployment processes for agile software development is invaluable. We now have far more capabilities in the context of improving testability as well, with unit tests that can also be automated. (Note: This is made even easier with the 4-series platform, which relies on the Mono runtime.)
- Reusability is often an overlooked benefit, in the shadow of change that many old school Crestron programmers have a distaste for. The gates are now nearly wide open for programmers to use virtually any open-source .NET library they want, as long as they comply with any applicable license agreements. Abstract C# code when written properly, is also inherently more reusable than code written in SIMPL Windows due to the nature of true polymorphism.
- You can also create extremely useful console commands for a multitude of purposes. Unlike with user program commands in SIMPL Windows, inside of a SIMPL# Pro application, you have access to any part of the program memory in terms of “state.” In SIMPL Windows, that state is isolated between each symbol, unless you’ve created signal ties between symbols, or you’ve created a SIMPL# library that allows you to share memory between instances of an object that only those symbols use.
To learn more about SIMPL#, we have developed a popular SIMPL# Fundamentals course that allows people to get their foot in the door. The course has proven to be a valuable resource for Crestron Dealers and CSP’s, regardless of whether their programming staff has beginner or intermediate knowledge on the subject. This course can be found here: https://www.tbdenterprises.ca/product/simplsharp-fundamentals-course. In the next couple months, we also hope to be unveiling a brand new course that focuses exclusively on SIMPL# Pro. Our goal is to leverage our extensive knowledge of the C# language to fill in the gaps for those who still find this technology confusing in the context of Crestron control systems.