SIMPL+ Best Practice

I just finished watching the videos posted of Toine lecturing at Crestron Masters 2017.  Sadly, this was a session I really wanted to sit in, but the space was reserved for veteran programmers (and this was my first time attending Masters).

He has many good points about how SIMPL+ has many bottlenecks to understand and work with, but one of his talks at the end covered GatherAsync.  He prefaced this section by quickly covering what he considers the best practice for writing a CHANGE event in SIMPL+.

Here’s an example showing the design pattern:

THREADSAFE CHANGE From_Device
{
    String Temp[MAX_LINE_LENGTH];

    While (1)
    {
        Temp = Gather("\r", From_Device);
        MakeString(To_Device, "RX: %s", Temp);
    }
}

This pattern works for 2-series and 3-series processors.  Toine even says he can’t think of a better way to process incoming data from a device.

Normally, SIMPL+ operates at the lowest thread priority.  The Gather function, however, runs at a higher priority so it can quickly service data coming in from devices.  I wanted to pull this one idea out of his talk and put it into a blog post so I could easily remind myself that this is Crestron’s best practice.

What’s In a Name?

Crestron SIMPL Windows uses “named signals” to wire up programming logic.  These signals are referred to as digital (either high or low), analog (a 16-bit number), or serial (a string of characters).  Color is used to distinguish what type a signal is–blue for digital, red for analog, black for serial, green for ambiguous–but otherwise, your only clue about what information a signal carries is left up to its name.

How then should you name your signals?  Let’s look at a few examples and see why they are good choices for signal naming.

Continue reading “What’s In a Name?”

New Language: Lua

Today I decided I would start playing around with Lua a bit to see how far I can go with the language.  I came across a post on Reddit this morning talking about the differences in versions, and learned that between 5.1, 5.2, and 5.3 the differences are great.  It looks like Lua is a very mature language that has stabilized, so probably a good time to give it a try.

I hope to post some of my projects here as I’m working on them.  It’ll be small snippets of code I’m sure, but hopefully it will be something interesting to follow.

The Search for a New Home

I’ve tried a few different web hosting providers over the years.  I think it was a particularly bad experience using GoDaddy that pushed me toward the VPS offerings, and eventually I settled in with Linode.  I’ve been with Linode for several years, but just recently cancelled my service.  My domain has wandered between different hosts for a few days now but has finally come to rest at WordPress.

GoDaddy is the absolute worst.  They boast a clunky, slow interface that hides common functions in bewildering places.  There are a few Internet sites that notoriously do this to you: Cisco, AT&T, BlueCross, etc.  They all lead to the same frustration by running you in circles until you finally give up.  When I finally ditched the GoDaddy domain, I felt a wave of relief.

My next foray was into Virtual Private Servers, and Linode was one that seemed reasonably priced and offered a wide selection of Linux server images that could be quickly deployed.  Over time, the specs for the VPS changed slightly (more disk space, more memory, less processor) and the price slowly increased.  Finally, I realized I was paying $20 a month for a service I was mostly not needing.  My immediate needs are pretty simple: just want to host a WordPress blog somewhere.

I set out looking for a new web hosting service and the landscape has changed considerably.  Everyone seems to offer some form of shared hosting, VPS, or dedicated server.  The prices for shared hosting are surprisingly cheap.  I tried IX Web Hosting, but was instantly reminded of the horrible experience I had using GoDaddy, and cancelled my account before anything could be billed.  I set up Amazon’s S3 service since it provides an introductory free tier.  But after a year, I’m not sure exactly how much I might be billed.

So I’m back to WordPress.  This time, I’m using a hosted WordPress and pointing back to my domain.  It’s easier than managing my own WordPress (which my VPS eventually turned into).  I think this will become the permanent home for my blog.