Getting Feedback from a Serial Device

A plugin that allows for end user development of multiple RS232 device control systems.
MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Getting Feedback from a Serial Device

Postby MurrayW » Tue Aug 11, 2009 5:06 pm

I just purchased an Onkyo PR-SC886P pre/pro and will either use this plugin to control it or the MLComDevice from Talluscorp.

What is the best way to get the status from the pre/pro?

For example, when I send a volume command, I assume I should also send a volume request command and take this returned value to update an MLServer variable.

Almost all of the time this unit will be controlled via RS-232, but there might be a few occaisions where the remote is used or someone manually turns the volume knob, changes an input, etc. For these cases, do I need to add a scheduled task that sends the request commands to the pre/pro every second? Would doing something like this overload either the MLServer PC or the Onkyo? Or is there a better way?

I also posted something very similar on the tallus forum, but since this forum is much more active, I wanted to post it here as well.

thanks,
Murray

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Re: Getting Feedback from a Serial Device

Postby ricks » Tue Aug 11, 2009 8:07 pm

Hey Murray,

Probably the first thing to do is determine if it uses hex or ascii. MLGenericDevice doesn't handle hex although I believe Tallus does - haven't tried it. That would make your decision easy. :lol:

I use MLGD a lot for ascii devices and some devices require you to follow-up a command with a query to get the status. Other devices simply return a system-wide status following any command with no need to send a query. Depends on the device. In either case, most devices will report its status serially when it is controlled remotely. One other thing, I don't believe MLGD is currently being supported - still in beta, I think.

For some reason I thought someone had already done an Onkyo plugin, maybe 3rd party?

Hope this helps,

Rick

T.Wells
Intermediate
Intermediate
Posts: 379
Joined: Sat Sep 30, 2006 8:19 pm
Location: Philadelphia Suburbs
Contact:

Re: Getting Feedback from a Serial Device

Postby T.Wells » Wed Aug 12, 2009 7:58 am

MurrayW wrote:I just purchased an Onkyo PR-SC886P pre/pro and will either use this plugin to control it or the MLComDevice from Talluscorp.

What is the best way to get the status from the pre/pro?

For example, when I send a volume command, I assume I should also send a volume request command and take this returned value to update an MLServer variable.

Almost all of the time this unit will be controlled via RS-232, but there might be a few occaisions where the remote is used or someone manually turns the volume knob, changes an input, etc. For these cases, do I need to add a scheduled task that sends the request commands to the pre/pro every second? Would doing something like this overload either the MLServer PC or the Onkyo? Or is there a better way?

I also posted something very similar on the tallus forum, but since this forum is much more active, I wanted to post it here as well.

thanks,
Murray


Murray,

I use MLComDevice to control my Onkyo NR-905. I do not have feedback working as of yet but I do have many 'send' commands already in my xml file. I will need to grab that file and send to to Tallus to add to the 'master' device file.

This should at least get you started if you choose to use MLComDevice as you will be able to jump right into the feedback portion of the programming sequence.

I made a few feeble attempts to get feedback from the Onkyo and I did not get it to work. I suspect I had some errors to my own response string code used to set the variable.

-T.Wells

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Re: Getting Feedback from a Serial Device

Postby MurrayW » Wed Aug 12, 2009 10:17 am

Rick and T.Wells,
Thanks for the replies.

So if a device sends out an RS-232 status message when someone manually turns the volume knob and you have the plugin configured correctly, it will passively capture that message and update an MLServer variable?

thanks,
Murray

User avatar
DavidL
Simply Incredible
Simply Incredible
Posts: 11071
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact:

Re: Getting Feedback from a Serial Device

Postby DavidL » Wed Aug 12, 2009 10:50 am

MurrayW,
Yes.
Some of the serial data support plugins can be configured to recognize a particular data stream from the device. The plugin is then configured (by you) to "do something". That "something" could be creating a variable like "Onkyo_Zone2_VolumeLevel = 45"

Some devices provide an outgoing serial message if something changes (like the volume). Your Onkyo should be one of these.

Other devices the plugin needs to be "told" to "get" a status update via "polling" on a regular (timed) or triggered basis.

Other devices don't say what the status is. Sometimes you have to guess based on last command sent to it and assume nothing locally changed that status.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Re: Getting Feedback from a Serial Device

Postby ricks » Wed Aug 12, 2009 12:39 pm

You may want to check out the AVS forum at http://www.avsforum.com/avs-vb/showthread.php?t=1083392. There's a lengthy thread on your device and post #20 has the owner's manual. I scanned the manual to see what protocol it uses and if they list the serial commands but didn't see it. I'm sure you'll find a lot of info in the forum. I did notice it will communicate via IP. So that may be another option.

My experience has been that most devices will update its serial port when changes are made via remote or manual control.

Rick

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Re: Getting Feedback from a Serial Device

Postby MurrayW » Wed Aug 12, 2009 12:50 pm

ricks wrote:You may want to check out the AVS forum at http://www.avsforum.com/avs-vb/showthread.php?t=1083392. There's a lengthy thread on your device and post #20 has the owner's manual. I scanned the manual to see what protocol it uses and if they list the serial commands but didn't see it. I'm sure you'll find a lot of info in the forum. I did notice it will communicate via IP. So that may be another option.

My experience has been that most devices will update its serial port when changes are made via remote or manual control.

Rick
Yeah, I have spent a lot of time there over the past couple of weeks. I did get the protocol from Onkyo and it is ASCII. http://www.avsforum.com/avs-vb/showthread.php?p=16962300#post16962300

It looks like the Onkyo does send out a status message when anything changes...I just wasn't sure that the plugin would know that this message was sent, then update the appropriate variables. I guess I just need to wait for it to arrive and then start playing with it.


thanks,
Murray
You do not have the required permissions to view the files attached to this post.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Re: Getting Feedback from a Serial Device

Postby ricks » Wed Aug 12, 2009 2:53 pm

So at least you have two options; MLGD or Tallus. That's good news. I think you'll find that either will do exactly what you want.

As for MLGD, if the Onkyo sends a string like C1V11 (Channel 1, Vol 11) you would enter C1V<<VAR>> into the response section of MLGD and make up your own variable name like Onkyo_C1_Vol and whenever the Onkyo sends a status, {{onkyo_c1_vol}} would be updated to 11. Then you can add MLS commands to it so that MLS executes these commands whenever MLGD sees a chnage in volume. So when you turn on the Onkyo MLS can close the drapes so no one will see you dancing around the house naked. :lol: I'm sure Tallus works the same.

The upside of a generic device plugin is that you don't have to wait for Cinemar to make one. The downside is that you pay the same price but do all the work and support yourself.

Rick

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Re: Getting Feedback from a Serial Device

Postby MurrayW » Thu Aug 20, 2009 12:37 pm

I went with the Tallus MLComDevice, but this is a generic question so I hope others who don't use MLComDevice can help me out.

The commands and responses to and from my Onkyo are ASCII. However some of the values sent or returned are in hex, like volume levels. If I want to set the volume level to 42 I send this command: !1VOL2A or if I request the volume level and it was set to 42 I get a similar response back with the "2A" hex value.

I have a volume set command defined in MLComDevice as Vol<Var1> and to set the volume to 42, I would send this command:

Code: Select all

MLComDevice|Onkyo~Vol~2A


What is the best way to handle the 01-100 decimal volume level possibilities?
    1. Create 100 different commands in MLComDevice, named Vol01, Vol02,..Vol100 that send the appropriate vloume level in hex
    2. Create 100 different command maps that substitute a different variable into the command MLComDevice|Onkyo~Vol~xx
    3. Use MLMath to convert the volume level from decimal to hex, and use a command map that does something like this:
      a. Sets a variable named Onkyo_Vol_Dec to 42
      b. Use MLMath and ToHex to convert 42 to 2A and set a variable named Onkyo_Vol_Hex to 2A
      c. Send the command MLComDevice|Onkyo~Vol~{{Onkyo_Vol_Hex}}
    4. Do the decimal to hex conversion from within a MLScript and substitute the hex value into MLComDevice|Onkyo~Vol~xx within the script

thanks,
Murray

User avatar
Fonceur
Expert
Expert
Posts: 583
Joined: Sun Sep 09, 2007 10:18 am
Contact:

Re: Getting Feedback from a Serial Device

Postby Fonceur » Thu Aug 20, 2009 7:11 pm

Currently, the easiest solution is probably just to have MLComDevice call MLScript with the pre-analyzed string, and do the processing in MLScript.
MLComDevice: Control serial/TCP device (ASCII/hex) - MLSchedule: Alternative to MLScheduler
MLBeyondTV and MLSageTV: PVR support - TChanger: Sony BDP-CX7000ES 400 disc Bluray changer
TRadio: Sirius/HD/XM radio - TChart: Chart from variable Wiki

T.Wells
Intermediate
Intermediate
Posts: 379
Joined: Sat Sep 30, 2006 8:19 pm
Location: Philadelphia Suburbs
Contact:

Re: Getting Feedback from a Serial Device

Postby T.Wells » Thu Aug 20, 2009 7:30 pm

Hello,

Here is the XML file that I am using for MLComDevice to control my Onkyo. While there is no 'feedback' included, it will give you a jump on the queries and the rest of the commands.

Hope this helps,
T.Wells
You do not have the required permissions to view the files attached to this post.

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Re: Getting Feedback from a Serial Device

Postby MurrayW » Thu Aug 20, 2009 7:40 pm

T.Wells wrote:Hello,

Here is the XML file that I am using for MLComDevice to control my Onkyo. While there is no 'feedback' included, it will give you a jump on the queries and the rest of the commands.

Hope this helps,
T.Wells
Thanks for the file...although I already have created my send commands. I'll take a look at it to see if I left anything out. I am bound and determined to get the feedback working, so I will post my results when I get that part figured out.

thanks again,
Murray

EDIT: T.Wells, I downloaded your xml and it only has the device settings, not the commands to control the device.

EDIT 2: Replaced my xml file. The original one had some illegal characters in it.
You do not have the required permissions to view the files attached to this post.
Last edited by MurrayW on Fri Aug 21, 2009 10:16 am, edited 1 time in total.

MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1198
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX
Contact:

Re: Getting Feedback from a Serial Device

Postby MurrayW » Thu Aug 20, 2009 7:45 pm

Fonceur wrote:Currently, the easiest solution is probably just to have MLComDevice call MLScript with the pre-analyzed string, and do the processing in MLScript.
That is what I thought. thanks

T.Wells
Intermediate
Intermediate
Posts: 379
Joined: Sat Sep 30, 2006 8:19 pm
Location: Philadelphia Suburbs
Contact:

Re: Getting Feedback from a Serial Device

Postby T.Wells » Thu Aug 20, 2009 7:49 pm

MurrayW wrote:
T.Wells wrote:Hello,

Here is the XML file that I am using for MLComDevice to control my Onkyo. While there is no 'feedback' included, it will give you a jump on the queries and the rest of the commands.

Hope this helps,
T.Wells
Thanks for the file...although I already have created my send commands. I'll take a look at it to see if I left anything out. I am bound and determined to get the feedback working, so I will post my results when I get that part figured out.

thanks again,
Murray

EDIT: T.Wells, I downloaded your xml and it only has the device settings, not the commands to control the device.


Murray,

Yes, I just realized that I added the wrong file. Here is a a second zip file with two additional xml files included. My commands are for all zone 1, zone 2, and zone 3 functions.

Sorry,
T.Wells
You do not have the required permissions to view the files attached to this post.

User avatar
Fonceur
Expert
Expert
Posts: 583
Joined: Sun Sep 09, 2007 10:18 am
Contact:

Re: Getting Feedback from a Serial Device

Postby Fonceur » Fri Aug 21, 2009 8:28 am

T.Wells wrote:Yes, I just realized that I added the wrong file.

Actually, it's the "user families" that you want to attach... The "known families" is the file distributed by Tallus which contains everything submitted...
MLComDevice: Control serial/TCP device (ASCII/hex) - MLSchedule: Alternative to MLScheduler
MLBeyondTV and MLSageTV: PVR support - TChanger: Sony BDP-CX7000ES 400 disc Bluray changer
TRadio: Sirius/HD/XM radio - TChart: Chart from variable Wiki


Return to “MLGenericDevice”

Who is online

Users browsing this forum: No registered users and 1 guest