Buiding Onkyo plugin using MLGenericDevice

A plugin that allows for end user development of multiple RS232 device control systems.
bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Buiding Onkyo plugin using MLGenericDevice

Postby bigDvette » Tue Aug 07, 2007 11:36 pm

I have a pretty big group of commands working so far. The one I am struggling with is teh volume control.

Most of the commands return a single value. Like !1PWR01 is power on and !1PWR00 is power off.

For volume up you send !1MLVUP and for down yu send !1MLVDOWN

What you get back is !1MLV08 and the last 2 digits are hex and can be in a wide range.

I guess my first question is how do you use data in the return string as a value. Can Ipull out the 08 without coding all possible values?

NExt question is can I convert from Hex to ASCII easily with some other plugin?

Thanks,

Donald

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

Postby T.Wells » Wed Aug 08, 2007 9:11 am

Donald,

I can't answer your question but it is great to hear that someone is working on Onkyo commands. I have a TX-NR905 and have been curious about RS232 control. Will you be able to share your work at some point?

Thanks,
T.Wells
Last edited by T.Wells on Wed Dec 31, 2008 9:45 am, edited 1 time in total.

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:

Postby ricks » Wed Aug 08, 2007 9:54 am

Hi Donald,

Not sure if this will help but I have a similar situation with the Xantech MRC. The syntax looks like ascii to me so it would seem strange that the actual value would be hex. If it is ascii and if the "08" is the value you are trying to capture, in the Device Response editor's Device Response line put !1MLV<<VAR>>

Then check the "Use Return Value" radio button and in the lower box type:

Function Return Value()
Return Value="<<VAR>>"
End Function

This will set the variable you named in the MLS Variable box to "08".

In the event the value returned, 08 in this case, is not on a 0-100 scale, you can use the Run Command box to run a MLServe Command using MLMath to put the response into a 100% scale for use with sliders. If the scale for Onkyo is 0-25, then you could run the following command:

MLServeCmd.MLMath|Mulitply~OnkyoVol~<<VAR>>~4

In the event the 08 is a hex code, poke around in this thread. Maybe you'll find some info to help.

http://www.cinemaronlineforums.com/foru ... conversion

Rick

90CE
Developer
Developer
Posts: 573
Joined: Mon Nov 28, 2005 1:19 am
Location: Waukee, Iowa
Contact:

Postby 90CE » Wed Aug 08, 2007 4:24 pm

Donald:

Try this:

Function returnvalue()
Dim tmpVolume

tmpvolume = cdec("&H" & <<VAR>>)

returnvalue = tmpvolume

End Function

I think your Onk goes from 0 to 100 so you should be fine. However, if you want to scale per ricks comments than you can do the following:

returnvalue = tmpvolume * 2 (would take 0-50 to 0-100).

There should be no need to call MLmath as all the math you would ever want to do can be done via scripting. :D

Tracy

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Postby bigDvette » Wed Aug 08, 2007 6:10 pm

Thanks guys, I'll play around with this and yes I will share my work as I get it working.

Here is what the manual says is returned (so yes it is 0 - 100 as the nr1000 uses 00 - 64 one and not the second one)

"00"-"64" Volume Level 0 – 100 ( In hexadecimal representation)
"00"-"50" Volume Level 0 – 80 ( In hexadecimal representation)
"UP" sets Volume Level Up
"DOWN" sets Volume Level Down
"QSTN" gets the Volume Level

What I will get back is !1MVL64 if the volume is 100.

If I understood teh first recommendation I would put

!1MVL<<returnvol>> in the device reponse line.

Then the "Use Return Value" radio button and in teh box put (sccording to he second recommendation)

Function returnvalue()
Dim tmpVolume

tmpvolume = cdec("&H" & <<returnvol>>)

returnvalue = tmpvolume

End Function

is this vp script or java scripting?

90CE
Developer
Developer
Posts: 573
Joined: Mon Nov 28, 2005 1:19 am
Location: Waukee, Iowa
Contact:

Postby 90CE » Wed Aug 08, 2007 6:19 pm

vbscript

Use:

tmpvolume = cdec("&H" & <<VAR>>)

instead of

tmpvolume = cdec("&H" & <<returnvol>>)

and

!1MVL<<VAR>>

instead of

!1MVL<<returnvol>>

jstaab
Senior Member
Senior Member
Posts: 159
Joined: Tue Mar 06, 2007 12:07 am
Contact:

Postby jstaab » Sat Oct 13, 2007 2:34 pm

As an FYI, CDec doesn't appear to work in a script. I'm using CLng instead in my script and I'm able to retrieve the volume from my Onkyo.

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

RS-232 Commands

Postby T.Wells » Fri Nov 16, 2007 6:02 am

I just wanted to throw this out there in case it may help. I noticed it over on AVS in the TX-NR905 thread.

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

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

Export of MLGD for Onkyo?

Postby T.Wells » Wed Dec 31, 2008 9:50 am

Hello Donald,

With the recent countdown to X-Mas sale here at Cinemar, I purchased a MLGD advanced plug-in. Are you willing to export what you have completed to share with me as I am just starting up with MLGD and a look at someone's work may help speed up the learning curve.

Thanks,
T.Wells


Return to “MLGenericDevice”

Who is online

Users browsing this forum: No registered users and 1 guest