A lot of the time, your receiver or television may not have a discrete code for every input. My 32" Vizio is a perfect example of this. I can switch directly to the RGB input, but there are three AV inputs and two component inputs and the only way to get to the higher number inputs is by cycling through them by pushing the AV or Component buttons multiple times. How do I successfully program them into the remote? Simple, for AV three, just macro the AV button three times, etc, etc.... Not so fast!!! If I am on AV 2 already and then run a macro that sends the AV button three times, I am not on AV three, but rather right back on AV2. So how do we get around this? Simple... Anchors.
So what is an Anchor you might ask? An anchor is any method you can think of where you can be sure of the state of the device. For example, if I push the RGB button on my remote, I KNOW that the television is on input type RGB. So how will ancors help us? Simple. If I know that the television is on input type RGB, then I also know that the next time I send the AV command it will be on AV one. So, if I am on AV two and I want to get to AV three, I would send RGB, AV, AV. On my old receiver if I wanted to be on optical three, I would send RCA, OPT, OPT, OPT. Are you getting the picture? Who would have dreamed it could be so simple?
There are some things to bear in mind. First, most devices can't handle commands rapid fire one after the other. You will likely have to insert a little bit of a delay between your codes to make them work right. Play around a little bit and you will get it down. Second, the delay can make your macro kind of long. One thing you can do to speed this up is to track the state of things with Variables. I have a separate variable for each input. Whenever I move to AV three, I set all the variables to off except the AVthree variable, which I set to on. This can be used to prevent the remote from running through a long anchor macro if you are moving from activity to the next but don't need to change inputs. This will require to use a variable-based macro. For more info on how to do this, please refer to my variables tutorial. Keep in mind though, as I have advocated in other tutorials, if you are depending on variables to track state, make sure you include a help page that allows you to work around this. For more information on this, again, please refer to the variables tutorial.
Finally, some times you won't be able to tell the EXACT state of the device. In this case, you can substitute knowing what state the remote is in, to knowing what state it isn't in. If you have two AV and two component, you can't ever know what exact state it is in by running a single IR code. But if you are trying to switch to AV one, you can know you are not on AV one or two by running the component IR code. This way you are anchored in "Not AV" and so the next AV code sent will put you to AV one. In the above example with my old receiver, I actually have five RCA inputs. The important thing is not that I know which RCA input that I am on, but rather, that I am not on any of the optical inputs.
For a solid example of the anchor concept, check out my system file in the files section of the site. Look in the TV device under the logic page.
As usual, it's best to refer any questions to remotecentral.com as the folks there are a lot quicker to respond than I am via email.
regards,
-aedile-