Configuring an If/Else statement to use a variable.
Lights, camera, ACTION!
The next option for an If/Else statement is an “Action Variable” – now don’t get your hopes up, it’s really far less exciting than it sounds. Basically this is the same as the nomenclaturely-challanged “Variables” already available on the MX-3000 and MX-950. Since the MX-900 doesn’t have native support for variables, having them on the MSC-400 makes it of even greater value to MX-900 users.
A variable is one of those concepts that appears far more intimidating than it really is. Variables work similarly to the sensor options we just discussed, however the conditions have changed slightly to “true” (on) and “false” (off). They are also not handled automatically, and must be created and changed via manual programming. The MSC-400 can manage up to 255 user-created variables... and if you need more than that you really have far too much time on your hands!
Adding new variables.
How are variables useful? Picture a television that has no discrete power codes and no other reliable way to check its operational condition. If you want to make that television a foolproof device that will always be powered on or off when it should be, simply start by creating a blank “Television On” variable. Then, for a simple discrete “Power On” macro, a statement for the MSC-400 would read “IF the TELEVISION ON variable is FALSE, THEN turn it on; ELSE do nothing”. You would also add a special “Action Variable” command to the macro’s “if” section that changes the “Television On” variable from “false” to “true”, so that the MSC-400 now knows that the television has been powered up. If the macro is run a second or third time nothing will happen. A “Power Off” version of the macro would simply do the opposite – “IF the TELEVISION ON variable is TRUE, THEN turn if off; ELSE do nothing”, and change the variable back to “false” so that the MSC-400 knows it is now off.
With more sophisticated programming it’s possible to use variables to solve other automation problems such as a lack of discrete input codes. It’s still preferable to use discrete codes or sensors as a first choice, since the MSC-400’s variables can potentially become out-of-sync with the actual components. If variables are going to be used with toggle codes, be sure to include a “fix it” button to step the user through correcting any synchronization issues that might crop up.
The third option for If/Else statements is a “Serial Variable”. Right now the option is grayed out and unavailable, but it will apparently be enabled when more two-way RS232 devices hit the market (or work is finished on it).
Don’t underestimate a toggle.
In addition to If/Else statements, the MSC-400 also supports a “Toggle” function that rotates through a series of codes each time the macro is run. This feature isn’t just limited to a single pair of codes as the toggle name might imply, but can include a list of commands of almost any length – and demonstrating the MSC-400’s versatility, that list can even incorporate nested (or aliased) macros. This would make it possible to program a single button on the remote control to scroll through a specific series of favorite television channels; each time the button is pressed advancing to the next channel.
This is also one place where the ostensibly useless “True” If/Else statement might find a raison d’être – instead of having to create a dozen separate favorite channel macros on the MSC-400 only to end up nesting them in a single toggle macro, the steps to each channel number could instead be grouped by one of these default “True” statements. Now, if URC could stop the software from displaying the never-transmitted “Else” section and then rename “If/Else True” more appropriately to “Command Group”...
|