Favorite Channels for Satellite or Cable TV
I'm sure this topic is one that will get some discussion going, because I'm pretty sure that almost every programmer has their own method for doing this. Here is what I usually do.
First, insert an Analog Initialize (INIT) into your program. The digital inputs will be the button presses, and the parameters will be the channel numbers in decimal. This is the only symbol you would need to edit if all of the channels changed, which makes it easy and scalable. We'll name the analog output "favorite_channel." If your program has more than one tuner, you'll want to be more specific, such as "living_room_cable_favorite_channel" or something like that. The more consistent you are with the signal names, the easier it will be to re-use your code later.
Second, insert a Serial/Analog One-Shot (AOS). This will be used to trigger the sequence when a new channel is selected. The AOS symbol take a Serial or Analog input, and pulses a digital whenever the input changes. We'll name the output "favorite_channel_mv." The _mv extension is a throwback to the Crestron Workshop days, when the One Shot symbol was called MV. Consider it tradition.
Third, insert a Stepper. This will contain the timing in which your IR signals will be sent. Again, if for some reason you need to speed up or slow down your IR commands, this is the only symbol you'll need to modify. The trigger is the output of our AOS. The busy is not needed and can be commented out. The outputs will be three digital signals to trigger the sending of the three digits (i.e. favorite_channel_send_hundreds, favorite_channel_send_tens, favorite_channel_send_units) followed by an enter command to the cable or satellite box. I tend to use delays of 0.2s and lengths of 0.3s as a starting point for IR devices. You can modify that based on the device you are using.
The next symbol is a Decade. This will "break down" the analog signal "favorite_channel" into a digital signal for each digit. (For example, if the analog signal fed into the decade is 562, the "hundreds5, tens6 and units2 outputs will be high)
Now, insert a Buffer (BUF). Drag the "send_hundreds" signal to the enable, and the "hundreds" outputs from the Decade to the tens inputs. The outputs should contain the IR commands for the cable or satellite box.
Copy the buffer using Ctrl-C and paste it twice using Ctrl-V. You should have three identical buffers. Select the second one down, press F9 (Search and Replace) and instruct SIMPL windows to replace "hundreds" with "tens" for Inputs and Comments. Repeat this on the third buffer, replacing "hundreds" with "units." This will save you some typing! See why it's important that all of our signal names are consistent?
Double check your search-and-replace (always double check any search-and-replace or auto-increment!). Your new buffers should look like this, and you should be ready to change channels. You can add as many inputs to the INIT as you want (go ahead and put every single Dish Network channel if you want!) and you'll only need these seven symbols to process it all.