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

Login:
Pass:
 
 

Topic:
If/Then Example
This thread has 6 replies. Displaying all posts.
Post 1 made on Tuesday July 14, 2009 at 00:36
ac3boy
Long Time Member
Joined:
Posts:
November 2003
24
Howdy all,

I am still confused after reading everything about making a query with PS on device status using RS-232.

If someone could write up an example that starts me down the path of a clue it would be greatly appreciated.

Here is what I want to do. Everything is RS-232.

I have a home screen that I access via the home button and I am already watching DVR1 and want to watch DVR2. Normally the script would have to go through all the motions not knowing the Receiver is already on and has to go thru all the delays the macro must do when it switches. I would like to tie a PS so that whenever I press DVR1, DVR2, etc it will poll the receiver on the status of power and even the status of the input it is on before running thru the macro. This was so much easier on the MSC-400. LOL

Any advice?

Thanks in advance.

Cheers!


Edit: I do not want to do Device Tracking since I have the ability to make a status query.

Last edited by ac3boy on July 14, 2009 00:47.
Post 2 made on Tuesday July 14, 2009 at 11:08
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Sure helps if you tell us the type of receiver or include link to PDF with protocol so we have some idea of the capabilities.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Tuesday July 14, 2009 at 21:13
ac3boy
Long Time Member
Joined:
Posts:
November 2003
24
Your fav Lyndel, Denon Serial.

I just want to use the PW? and the SI? query command. Once I see how to do it I will figure out any other queries for other devices.

I also want the button to double as a working button, not something hiding on a page.

Thanks!
Post 4 made on Wednesday July 15, 2009 at 01:26
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
If doing this using syncrhonous serial port...

Set following parameters programmatically.

9600, No parity, 8 data bits, and if you can, 1 stop bit.

var pwrResponse = mySerial.match('PW?\r','\r',2000);
var siResponse = mySerial.match('SI?\r','\r',2000);

Note that responses will have '\r' at the end and you will have to trim them.

FYI, the examples in the dev guide specifically do 'MVUP\r' or 'MVDOWN\r' and were written for denon receiver. Please have a read through the dev guide and try out the examples.

Now, on to using this as macro. Add any actions you want to a button. Click the 'PS' icon on the toolbar to enable ProntoScript for the button.

//===========================================
// This code will execute the current button's actions if power is off.
//===========================================
// TODO - Put code in to retrieve current extender and target serial port.
// You can see dev guide for example on how to do this.

var pwrResponse = mySerial.match('PW?\r','\r',2000);
if (pwrResponse.substring(0,5) === 'PWOFF')
{
// try/catch extra bulletproofing if jump action is present.
// Search this forum for ActionList Error.
try{this.executeActions();}catch(e){};
}
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 5 made on Wednesday July 15, 2009 at 01:30
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
On July 14, 2009 at 21:13, ac3boy said...
I also want the button to double as a working button, not something hiding on a page.

FYI, Prontoscript can ONLY be activated from visible buttons on a page. It can also be executed upon entry into an activity or into a page.

I understand your eagerness to experience these new powers but you will save yourself lots of grief and headaches as well as time posting many questions if you create small configurations and test through the examples as best you can in the Dev Guide.

Please don't take this the wrong way. I am not trying to beat you down, but rather, build you up and make you more productive in the Pronto Javascript world.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 6 made on Wednesday July 15, 2009 at 22:21
ac3boy
Long Time Member
Joined:
Posts:
November 2003
24
I would if I could. I am good with alot of things but when it comes to scripting, God did not allow me the ability to create something new but just modify something done.

Thanks for the tip. It is all I wanted as a starting point to modify. I use RS-232 on all my installs. I just have issues with javascript.

Thanks again for the help.


...and I respect your advice as well.
Post 7 made on Thursday July 16, 2009 at 10:07
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Good luck.
Lyndel McGee
Philips Pronto Addict/Beta Tester


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