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

Login:
Pass:
 
 

Page 1 of 2
Topic:
Pronto TSU9600 via RFX9600 RS232 talk with Sierra Video Pro Matrix 88V5S
This thread has 17 replies. Displaying posts 1 through 15.
Post 1 made on Thursday September 9, 2010 at 18:05
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
I would like to get help to make sure I am writing pronto code right to sending the right Sierra protocol ASIIC commands to the matrix so it will understand the code.

for example if I use Hyperterminal and I have to setup the Hyperterminal File, Properties, Settings, and Emulation has to be set to ANSI so it will work properly.

Then if I send **Y8,3!! That will change my Matrix like this Destination number then Source number. The Matrix has to read this command **Ydestinationnumber,sourcenumber!! just like that, know can I send it using String (Representation of a text string)? or source (The regular expression text) or can I just do s.send() for RS232 because it will communicate like this Matrix RS232 to RFX9600 RS232 so I know I have to write/send this via RS232.

what I know is that I first in pronto code have to do this right?

var e,s;
e = CF.extender[1];
if (!e) {
Diagnostics.log("Extender 1 is not defined");
} else {
s = e.serial[0];
if (!s) {
Diagnostics.log("Extender 1 is not a serial extender");
} else {
s.bitrate = 9600;
s.databits = 8;
s.parity = 0; // None
s.stopbits = 1;
s.onData = function(v) { label = v; };//--is this were it goes?
label = s.match("**Y8,3!!\r","\r",250);
}
}
//------how do I make sure Flow control is: Xon / Xoff ?

Now that the serial port is configured, a command can be sent to it to turn the Matrix command to switch Destination number and Source number:
s.send("**y8,3!!\r");
This sends the string "**y8,3!!" followed by a carriage return over the serial line.

how do i put this in

The above script uses 'synchronous' serial communication. This means that the match function stops the script, effectively blocking the control panel until the response is received. As explained before, blocking the control panel is generally not a good idea. A better way to do this is to define a callback function for receiving the data:

s.onData = function(v) { label = v; };

Now the line:
s.match("**Y8,3!!\r", "\r", 250);

will not block the control panel anymore. The script will finish, and when the response with the volume is received from the A/V receiver, the anonymous inline function is called, which will set the label.

Would this work or do I need more?

More info that may help

“Y”: Connect AFV

Use command Y to request that a connection be made. It must be followed by an output number, a comma, and an input number. The connection is made on all levels (AFV). For example, the command:

**Y2, 8!!

This string says that input 8 is to be connected to output 2 on all levels.
Post 2 made on Thursday September 9, 2010 at 19:13
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
RFX9600 does not support hardware flow control.

Assuming that variable 'label' is simply a string, you will get any response stored there. However, if you have assigned the variable 'label' as the widget for some panel on your screen, you will need to use label.label.

If the protocol is as you say, **Y8,3\r should connect input 8 to output 3. You should get some sort of response back. I suspect you may have to parse something out of that response (using String.split() or String.substring()) but assigning the response to a label is a good start.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Thursday September 9, 2010 at 19:16
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
with all that said this below send the command out to the RFX9600 and i see a light flash, but when i check my Matrix nothing.
var e,s;
e = CF.extender[1];
if (!e) {
Diagnostics.log("Extender 1 is not defined");
} else {
s = e.serial[0];
if (!s) {
Diagnostics.log("Extender 0 is not a serial extender");
} else {
s.bitrate = 9600;
s.databits = 8;
s.parity = 0; // None
s.stopbits = 1;
s.send("**OK!!");
label = s.match(" ","\r",250);
}
}

In Hyperterminal you have i can do this:

After the command string has been executed, the routing switcher returns the string " OK " (with
a single space character before and after the word "OK"), followed by the trailer (!!) and a CR
(carriage return, ASCII 0D) character, to the host. This indicates that the command has executed
GENERIC PROTOCOL
31
successfully. If an error occurs within any command of a command string, the remainder of the
command string is ignored and the router returns the string " ERROR ", followed by an optional
descriptive string followed by a string of trailer characters and a CR character, to the host. An
error can be caused by an unknown command name or bad arguments to a command.
The simplest possible command string would be:**!! which consists of the leader and trailer
characters but no commands between them. This command string would generate the response:
** OK !!
This can be useful for verifying that the serial link to the router is operational. In routers requiring
only one leader/trailer character, the simplest command string would be: *! which would generate
the response:
* OK !

how can i also check to see if i am getting anything back from the Matrix RS232 I have been looking at the sending and receiving command label = s.match("i have a question here\r","\r",250); this is for receiving but how do i get its information like with Hyperterminal.

I thank you for any of your time, I just need a little more understanding of this for the matrix and then i should be ok
Post 4 made on Thursday September 9, 2010 at 21:34
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
See the Dev Guide for Serial.send() and Serial.receive(). With the latter, you can pull data from the port should it be available. Note that a call to Serial.send() or Serial.match() will clear that buffer prior to send if you send anything other than an empty string or null.

If Serial.match() is not returning any data then you should also code the OnTimeout() function for the serial port because partial data will be delivered there. If OnTimeout() is missing and you are not receiving the CR (\r), the partial data is discarded. If this new callback function (OnTimeout) does not report any data, then you are likely not receiving anything and this could be due to flow control.

As clarification to a previous statement, the RFX9600 does not natively support hardware or software handshaking.

Further research into XON/XOFF yields this to be a software-based flow control scheme in which you send 2 different control characters to do flow control. These character must be embedded in your message. Personally, I've never had to muck with this but I did do a bit of googling.

Here's a link I found.

[Link: social.msdn.microsoft.com]

My personal preference would be to see if there is a way to turn XON/XOFF flow control as it would indeed make your protocol a bit easier.

FYI, Windows and Hyperterminal do this stuff for you base on COM port setup as there is a protocol/handshake layer between the COM port and the Hyperterminal program.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 5 made on Thursday September 9, 2010 at 21:48
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
I did some more searching and finally found a PDF for the protocol. If you had this link already, shame on you for not posting prior to whole discussion as it would have made things 1000% easier. ;-)

I presume you are referring to this PDF...

[Link: sierravideo.com]

Inside this PDF, you should see pages 28-29 which outline the Select System Parameters Setup and you will see that they do allow you to turn off the XON/XOFF handshaking (it is on by default).

If you do this, then you should not have to worry about any flow control (your coding will get alot easier as you don't have to embed XON/XOFF control characters in your messages) when you disable flow control, you should set Flow Control to None in Windows for use with Hyperterminal.

And, after you disable XON/XOFF, you should start seeing that Serial.match() is returning data as you would expect. :-)
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 6 made on Friday September 10, 2010 at 03:16
BluPhenix
Long Time Member
Joined:
Posts:
December 2008
371
Sorry but this:

s.send("**OK!!");
label = s.match(" ","\r",250);

Does not make sense. You first send something to the device without listening to what the device replies to you. Then you send nothing to the device and you expect a response from the device.

label = s.match("**OK!!","\r",250);

makes sense, but I don't know if this is what you want.
__

The command: s.send("**y8,3!!\r"); is wrong, you must not provide any \r at the end of the command string, so:
s.send("**y8,3!!"); is the right way to do it.
__

If you send label = s.match("**!!","\r", 2000);

You should get back "** OK !!\r", do you get it? If you do the comm is working ok.
__

Instead of hyperterminal you can use Br@y's Terminal, it's just what you need for serial communication, simple and with the right features
[Link: sites.google.com]

Last edited by BluPhenix on September 10, 2010 03:39.
Post 7 made on Friday September 10, 2010 at 11:08
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
What Blu says holds true for Pronto if you turn off the XON/XOFF handshaking. Otherwise, it will work for the terminal emulator in windows only.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 8 made on Monday September 13, 2010 at 11:03
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
Thank you
OP | Post 9 made on Monday September 13, 2010 at 11:09
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
On September 9, 2010 at 21:48, Lyndel McGee said...
I did some more searching and finally found a PDF for the protocol. If you had this link already, shame on you for not posting prior to whole discussion as it would have made things 1000% easier. ;-)

I presume you are referring to this PDF...

[Link: sierravideo.com]

Inside this PDF, you should see pages 28-29 which outline the Select System Parameters Setup and you will see that they do allow you to turn off the XON/XOFF handshaking (it is on by default).

If you do this, then you should not have to worry about any flow control (your coding will get alot easier as you don't have to embed XON/XOFF control characters in your messages) when you disable flow control, you should set Flow Control to None in Windows for use with Hyperterminal.

And, after you disable XON/XOFF, you should start seeing that Serial.match() is returning data as you would expect. :-)

about the sierravideo pdf pages 28-29 for print out pages are 22-23
OP | Post 10 made on Wednesday September 15, 2010 at 12:44
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
On September 10, 2010 at 11:08, Lyndel McGee said...
What Blu says holds true for Pronto if you turn off the XON/XOFF handshaking. Otherwise, it will work for the terminal emulator in windows only.

Ok, Thank you Lyndel McGee I was able to turn off the Xon/Xoff handshaking and then in the database created a RS232 ASCII command with the right matrix in and outs that I needed and it is working.
OP | Post 11 made on Wednesday September 15, 2010 at 20:09
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
On September 10, 2010 at 03:16, BluPhenix said...
Sorry but this:

s.send("**OK!!");
label = s.match(" ","\r",250);

Does not make sense. You first send something to the device without listening to what the device replies to you. Then you send nothing to the device and you expect a response from the device.

label = s.match("**OK!!","\r",250);

makes sense, but I don't know if this is what you want.
__

The command: s.send("**y8,3!!\r"); is wrong, you must not provide any \r at the end of the command string, so:
s.send("**y8,3!!"); is the right way to do it.
__

If you send label = s.match("**!!","\r", 2000);

You should get back "** OK !!\r", do you get it? If you do the comm is working ok.
__

Instead of hyperterminal you can use Br@y's Terminal, it's just what you need for serial communication, simple and with the right features
[Link: sites.google.com]

right because you have to send something first then getting an answer for.

Thank you
Post 12 made on Wednesday September 15, 2010 at 20:13
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Glad you are off to the races...
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 13 made on Wednesday September 15, 2010 at 20:19
bnokes@AAVViD
Long Time Member
Joined:
Posts:
June 2009
31
On September 10, 2010 at 03:16, BluPhenix said...
Sorry but this:

s.send("**OK!!");
label = s.match(" ","\r",250);

Does not make sense. You first send something to the device without listening to what the device replies to you. Then you send nothing to the device and you expect a response from the device.

label = s.match("**OK!!","\r",250);

makes sense, but I don't know if this is what you want.
__

The command: s.send("**y8,3!!\r"); is wrong, you must not provide any \r at the end of the command string, so:
s.send("**y8,3!!"); is the right way to do it.
__

If you send label = s.match("**!!","\r", 2000);

You should get back "** OK !!\r", do you get it? If you do the comm is working ok.
__

Instead of hyperterminal you can use Br@y's Terminal, it's just what you need for serial communication, simple and with the right features
[Link: sites.google.com]

If you send label = s.match("**!!","\r", 2000);
You should get back "** OK !!\r", do you get it? If you do the comm is

so if label = s.match(" ", "\r", 2000); is the \r for return and does it have to be in there?
Post 14 made on Wednesday September 15, 2010 at 20:54
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
\r (just like in C/C++) is Carriage Return.

You need to remove the extra space in " " such that your command looks like:

label = s.match("", "\r", 2000);

What this line does is wait up to 2 seconds to receive a line of text from the serial port. The empty string (same as null) in the first parameter sends nothing and therefore this match operation only does receive with timeout of 2 seconds. I highly recommend reading Appendix A or B of the Dev Guide that discusses each of these functions based on the ProntoScript object type. If it is not in an appendix, there should be a dedicated section in the guide for these. I can't recall if they removed the appendix in the latest dev guide but it was there in previous releases and was invaluable.

Assuming that you get a string (the extender saw a string ending in \r within 2 seconds), the variable label will contain the string received provided that you have not assigned an onData and onTimeout functions (asynchronous serial port usage).
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 15 made on Thursday September 16, 2010 at 02:01
BluPhenix
Long Time Member
Joined:
Posts:
December 2008
371
On September 15, 2010 at 20:19, bnokes@AAVViD said...

so if label = s.match(" ", "\r", 2000); is the \r for return and does it have to be in there?

Yes the \r (or any other last char the device sends you) has to be there if you're using match(). This command basically says when I send you something i'll wait for a string from you and I'll read that string until i encounter an \r inside it, then I'll stop reading and provide the data to the user. But I won't wait for more than 2 seconds for this \r of yours. If the 2 seconds pass I'll provide the user the uncomplete data I'll get till the 2 seconds pass (could be none).

As said " " or "" is not a valid value.
Page 1 of 2


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