Your Universal Remote Control Center
RemoteCentral.com
Complete Control by URC Forum - View Post
Previous section Next section Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Topic:
MX-890, variables & if statements
This thread has 12 replies. Displaying all posts.
Post 1 made on Tuesday February 26, 2008 at 07:37
SpotTheWonderDog
Long Time Member
Joined:
Posts:
February 2008
10
I'm already very experienced in programming in a variety of languages, so I don't require any help in those concepts.

What I'm finding confusing is that they don't seem to work as I would expect on this device.

For example, this is what I would expect to happen:

If (somevariable == false )
{
actions here ;
somevariable = true ;
}

Yet, those actions always occur.

So I tried this as a test:

somevariable = true ;
If (somevariable == false )
{
actions here ;
somevariable = true ;
}

And the actions still occur anyway.

What am I misunderstanding?
Post 2 made on Tuesday February 26, 2008 at 14:04
remotejr
Long Time Member
Joined:
Posts:
June 2007
206
I'm already very experienced in programming in a variety
of languages, so I don't require any help in those concepts.

Just an FYI Mr. Experience Programmer, Universal Remote Control Inc. don't make an MX-890 remote.
You win some, you loose some...
Post 3 made on Tuesday February 26, 2008 at 14:49
Darnitol
Universal Remote Control Inc.
Joined:
Posts:
June 1999
2,070
(Obvious formalities out of the way first: MX-890 = MX-980, I'm assuming.)

It's a little hard to follow your question since it's not formatted the way the MX-980 editor expresses it, but I'm pretty sure I have the answer. Probably the key you're overlooking is that MX-980 explicity supports IF/ELSE, but not just IF. You need to declare both the "IF" case and the "ELSE" case. (You can sort of do an IF by keeping one side of the expression blank, of course.)

So first, in the If Setting dialog box, set your trigger event. So, let's say you set the IF Setting for a macro step to give the variable "FAIL" a trigger value of "False."

Obviously at this point, you program your macro steps for what happens on "IF," where the case of "IF" is that when the macro is run, "FAIL" is set to False. The second part of the macro therefore occurs when "FAIL" is set to True.

Some even external to this macro step sets the value of "FAIL," and the IF/ELSE statement acts on the valie of "FAIL" to produce either the "IF" case or, if the "IF" case is not satisfied, it defaults to the "ELSE" case.

Does that help?

Best regards,
Dale
I'm a member of the Remote Central community, just like you! My comments here are my own, and in no way express the opinions, policies, or plans of Universal Remote Control, Inc.
OP | Post 4 made on Tuesday February 26, 2008 at 20:00
SpotTheWonderDog
Long Time Member
Joined:
Posts:
February 2008
10
On February 26, 2008 at 14:49, Darnitol said...
(Obvious formalities out of the way first: MX-890 = MX-980,
I'm assuming.)

It's a little hard to follow your question since it's
not formatted the way the MX-980 editor expresses it,
but I'm pretty sure I have the answer. Probably the key
you're overlooking is that MX-980 explicity supports IF/ELSE,
but not just IF. You need to declare both the "IF"
case and the "ELSE" case. (You can sort of do an IF by
keeping one side of the expression blank, of course.)

So first, in the If Setting dialog box, set your
trigger event. So, let's say you set the IF Setting for
a macro step to give the variable "FAIL" a trigger value
of "False."

Obviously at this point, you program your macro steps
for what happens on "IF," where the case of "IF" is that
when the macro is run, "FAIL" is set to False. The second
part of the macro therefore occurs when "FAIL" is set
to True.

Some even external to this macro step sets the value of
"FAIL," and the IF/ELSE statement acts on the valie of
"FAIL" to produce either the "IF" case or, if the "IF"
case is not satisfied, it defaults to the "ELSE" case.

Does that help?

Best regards,
Dale

To make the remote as easy as possible for my wife, I set a number of watch activity buttons, 'Blu-Ray, 'Cable' etc.

I don't want her to first press this button then press this button, then ....

So, when she presses 'Cable' button, a power on macro turns on all the devices, sets HDMI-2 on the receiver, then jumps to the cable page. She shouldn't have to know to first press the 'On' button.

But, if the devices are already turned on, then they shouldn't have to be turned on again if she decides to take a look at another device then come back to cable.

Absolutely no different than if you've already started your automobile then walked backed in the house to get something, you don't need to restart your vehicle again.

My logic in short is something like this:

TEXT (cable)
If ( UI(Var( POWERED_UP, False )
UI Var( POWERED_UP, True )
... turn the devices on macro ...'
ELSE

ALIAS(Receiver/Page3/HDMI-2)
DELAY(1.0 Second)
JUMP(Cable/Page1)

However, regardless of the value of my POWERED_UP variable, the devices are always turned on. The program flow doesn't seem to honor the value of the variable.

This is especially irksome for my cable box which doesn't have a discrete power on/off IR code. The software in the cable box has a bug and if the cable box isn't used for awhile while I'm using another device, then I lose connectivity to cable (I have to turn the cable box off for a few minutes then turn it back on again) so I need to set a variable that turns the cable box off only if the variable CABLE_PWR on is set to true and vice versa. In other words, if I call the power on/power off macros, then I need to turn the cable box on or off based upon the CABLE_PWR value.

The other thing that confuses me is how does one know what the state of a variable is? In most programming languages, you declare a variable then set it to a known value. In the MX-980 there is no entry code; no place to set your variable values.

It would be really nice it there was a debugger in the editor.
Post 5 made on Tuesday February 26, 2008 at 23:36
Darnitol
Universal Remote Control Inc.
Joined:
Posts:
June 1999
2,070
You set the value for a variable in the Macro pane for the currently selected button.

Select the button that you want to use to alter the state of a variable, then double click the UI Variable button (it's the one with the little red rectangle containing the letters UI, pluse a little blue page and a little yellow page).

The UI Variable Setting dialog box lets you select a variable from the variable list, then set what value the button will give to that variable using the drop-down immediately beside the OK button. If you haven't yet created the variable you need, you can also create the variable in this dialog box.

So I suspect that if you hadn't yet discovered this, probably what's going wrong in your macros is that you're thinking that some other event is setting variable values for you. It sounds like perhaps you're thinking that the button press itself sets the variable, when it does not. In fact, you can control the state of many variables at once with a single command, all set at this one step of the macro using the UI Variable Setting dialog box.

I think that as a programmer you're probably thinking that the MX-980 uses higher-level coding than it really does. At best, programming an MX-980 is merely scripting. We designed it that way because for 99% of installers, scripting will meet their needs without complicating their programming jobs. To make the scripting capability usable but not the focal point of the macro command list, we employ various UI elements to serve up the macro capabilities. For guys like you who know their way through a compiler, you're probably looking for the equivalent of a command line that unfortunately doesn't exist.

Having said all that, do know that once you know where all the features are, it's quite a snap to program an MX-980. You've just got to keep in mind that you don't have your full vocabulary of logic at your disposal.

Best regards,
Dale
I'm a member of the Remote Central community, just like you! My comments here are my own, and in no way express the opinions, policies, or plans of Universal Remote Control, Inc.
Post 6 made on Wednesday February 27, 2008 at 08:40
Joe-CI
Long Time Member
Joined:
Posts:
May 2007
183
Nothing wrong with your logic. You just need more time with the software.
What you need to do can be done by the MX980 period.

Your cable box can be tricked into having discrete ons and offs in some cases.

The more advanced variable control that you want but do not appear to need is a trait of RTI and up as far as remotes go.

Support Your Local Dealer.
Stop Buying From the Online Guy and Ebay.
Post 7 made on Wednesday February 27, 2008 at 13:11
mdrew
Long Time Member
Joined:
Posts:
September 2006
55
While you guys are talking about the 980 and IF statements, I’ve been trying to set up my device buttons in a way that will allow me to use them to JUMP to the device page, but also reconfigure my gear for each device. But I'm trying to use the same device button to do two different things, and I'm not doing it correctly.

I put in a Press/Hold value = < 1 second JUMP
Then I put in another Press/Hold value = > 1 second (macros for setting up gear for this device) – JUMP.

This does not work. Each time I press the device button, regardless of hold time, it reconfigures my gear. I do not want it to reset everything to the device unless I tell it to (with a hold time or other means). What am I doing wrong?

BTW – I AM NOT an advanced user / programmer.
Post 8 made on Wednesday February 27, 2008 at 15:02
mdrew
Long Time Member
Joined:
Posts:
September 2006
55
I just figured out what I was doing wrong my….

I didn’t have the commands ‘inside’ the IF / Else statement brackets.
Post 9 made on Friday February 29, 2008 at 18:55
KVH
Advanced Member
Joined:
Posts:
December 2006
911
Depending on the model/brand of cable box... try these macros for on/off.

On= Menu, delay, power command.
Off= Menu, delay, power command, delay, power command.
All high's, all low's, it must be.......
Einstein @ URC Control Room forum
www.einsteinaudiosystems.com
Post 10 made on Sunday March 16, 2008 at 16:14
ktixx
Lurking Member
Joined:
Posts:
March 2008
5
Also - On most cable boxes you can turn on the "Power and Numeric" setting in the menu. This way, a numeric key will turn on the cable box (but not off - IE: discrete on). In my case I do the following:

Macro:
cable box 0
cable box exit
wait 5 seconds
cable box exit

I have the redundent exits in there becuase if the cable box is off it will only accept a command after 5 seconds and will send a 0 to the box only after it boots up (about 4.5 seconds). If the box is already on it will instantly try to change to channel zero, so thats why the first exit is there. In addition, if for some reason none of my exits work, there is no zero channel on my cable box, so nothing will happen (exept the power turning on).
Post 11 made on Tuesday December 18, 2012 at 13:22
davisadm
Lurking Member
Joined:
Posts:
September 2008
1
On February 26, 2008 at 14:04, remotejr said...
Just an FYI Mr. Experience Programmer, Universal Remote Control Inc. don't make an MX-890 remote.

Now they do!!!!! :-)

Just announced!
Available now.
Looks like it is an updated MX-880. The difference being having the four color (Red, Green, Blue, and Yellow) hard buttons, which many devices now use.
Davis
Post 12 made on Tuesday December 18, 2012 at 15:07
Duct Tape
Loyal Member
Joined:
Posts:
November 2008
5,295
On December 18, 2012 at 13:22, davisadm said...
Now they do!!!!! :-)

Just announced!
Available now.
Looks like it is an updated MX-880. The difference being having the four color (Red, Green, Blue, and Yellow) hard buttons, which many devices now use.

good job informing those discussing this 4 years ago.  you win the internet award!
[Link: facebook.com]
Post 13 made on Tuesday December 18, 2012 at 16:05
JoeFlabitz
Select Member
Joined:
Posts:
December 2008
1,517
On December 18, 2012 at 13:22, davisadm said...
Now they do!!!!! :-)

Just announced!
Available now.
Looks like it is an updated MX-880. The difference being having the four color (Red, Green, Blue, and Yellow) hard buttons, which many devices now use.

Actually, there are numerous upgrades to the MX-880:
* As stated, the R/G/B/Y are new
* It has a charging base, with the tilt of the MX-1200 (including a power port at the bottom of the remote)
* It uses CCP programming like the MX-980 with conditional variables
* The device count is considerably larger @ 200 devices with 10 pages per device.

[Link: universalremote.com]


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse