MLGenericSerial plugin v2.0

Repository of MainLobby Server plug-ins and updates not available in the current installation.

Postby jpimentel » Thu Jun 16, 2005 9:07 am

The previous post was me :D
Regards,

John
User avatar
jpimentel
Expert
Expert
 
Posts: 591
Joined: Tue Feb 04, 2003 12:28 pm
Location: Waterford, WI

Postby rlindblad » Thu Jun 16, 2005 3:30 pm

rlindblad
Expert
Expert
 
Posts: 712
Joined: Sat Jan 29, 2005 2:15 pm

Postby bwally » Thu Jun 16, 2005 3:53 pm

i also have an Integra ... an integra dtr7.2 ... and the volume commands are a bit different than what you might expect (i think in serial commands they only go to 64 ... which would be the loudest and the same as 100 on the dial).

i didn't have much problem getting them working with ML

do you have the pdf that describes the integra rs232 protocol?
another steve
bwally
Intermediate
Intermediate
 
Posts: 364
Joined: Sat Aug 14, 2004 6:23 am
Location: ontario, canada

Postby jpimentel » Thu Jun 16, 2005 5:25 pm

Bob,

Thanks for that. I will have a look.

bwally,

I have this spreadsheet (attached). I am using a DTR 6.5 and a 10.5 also which is not on the sheet, but has the same function as the 6.5 (jusrt a differnet offset on the display (the 10.5 reads -82 to +18 on the front panel instead of 0-100.

Did you get the incoming serial data for volume level to map to an intelligble number in a variable? If so I am curious how you did it.

As always, thanks to all.
Attachments
Integra Receivers.xls
(183.5 KiB) Downloaded 17 times
Regards,

John
User avatar
jpimentel
Expert
Expert
 
Posts: 591
Joined: Tue Feb 04, 2003 12:28 pm
Location: Waterford, WI

Postby jpimentel » Thu Jun 16, 2005 6:40 pm

OK so I hacked away at the file and this is what I came up with. Please don't laugh if it is horribly wrong, I don't do vbscipt. :oops: Does this look like it might work?


[CODE]

function doCommand(command,client)
Dim vol,vola,volb

'This receives commands from MLServer for processing
'command = everything after | in the command
'client = name of the client that issued the command

'Use the incoming command to change variables, perform system actions, etc.

'This is how to set/change a variable in MLServer
'mlServer.setVariable "myPlugin","hello"
'This is how to send an MLServeCmd
'mlServer.cmdReceive "MLServeCmd.MLCommand|MLCmd~test"

vol = CInt(command) 'is this what comes in from the command line???

' if the hex of volz is less than 2 characters, add a leading zero
if len(vol) = 1 then : vol = "0" & CStr(vol)

'convert the values to digital from hex to set display variable
vola = Cint(left(vol,1))
volb = Cint(right(vol,1))
mlServer.setVariable "IntegraVol", CStr(vola) & CStr(volb)


'Uncomment the following line if you just want to control the main directly from here...
'mlServer.cmdReceive "MLServeCmd.MLGenericSerial|Send~02323330" & vola & volb & "03"
end function
Regards,

John
User avatar
jpimentel
Expert
Expert
 
Posts: 591
Joined: Tue Feb 04, 2003 12:28 pm
Location: Waterford, WI

Postby Guest » Fri Jun 17, 2005 7:58 pm

Any comment from the experts (Bob) on if this will work? If so how do I compile and call it from ML?

Thanks...
Guest
 

Postby rlindblad » Sat Jun 18, 2005 7:04 am

It passes a quick desk check. Now on with the show...

To install a .wsc file, just put it into the plugin directory for MLServer, usually:

C:\Program Files\MLServer\plugins

Make sure MLServer.exe is not running. Now right click the file, and select install. Restart MLServer.

Open MLServer and select the plugin you created. Click on the help button. If you see the help lines you put in, you did it all correctly! :o

Now use the plugin as you would any other (you made up the protocol...) :) .

Enjoy!

Bob

PS I almost blew a set of JBL ceiling speakers testing mine! :twisted:
rlindblad
Expert
Expert
 
Posts: 712
Joined: Sat Jan 29, 2005 2:15 pm

Postby bwally » Sat Jun 18, 2005 7:56 am

when it came to controlling the integra i couldn't think of a good reason why i would need two-way communication with the volume control or why i would have to covert the rs232's 0-64 scale to the dials 0-100 scale. i have always found the best approach for me is to work with the way a "thing" works or wants to work and not try to alter it into working the way i think it should work. unless of course, i built it myself (or married it - which has a lot to do with my philosophy :lol: )

but now you got my interest into this 2-way feedback thing ... just because it might be cool to try something with one of the Library14 sliders ... but, if i were going to do something i would just use a dial or a slider to display current volume, and work with the 0 - 64 scale. no conversion. and just have a graphical representation of where the volume is that way.

i should mention, there is no hexadecimal figures in the way my DTR7.2 works. it is all ascii and straight from 0 to 64 communication both ways ... so 32 would be half way. is that something with your conversion, or does your Integra work that way?

thanks,
another steve
bwally
Intermediate
Intermediate
 
Posts: 364
Joined: Sat Aug 14, 2004 6:23 am
Location: ontario, canada

Postby jpimentel » Sun Jun 19, 2005 2:17 am

Hi Bob,

Thanks as always for continuing to spoon feed me here.

I did all the above and it doesn't seem to work :(

After installing and re-starting MLServer, the plugin shows up in MLServer but when I execute, nothing happens not even the wrong thing. What I was trying to do was this...

MLServeCmd.IntegraVolumehex2dec!f

That "should have" populated a varaible in MLServer called IntegraVol to a value of 16 ( I would be happy it it just created the variable.

Any idea how I can debug? I don't have any sophisticated tracing tools but if there was something I could download I could use that.

I will attach the script here so you can give it a spin if you are up to it.

Thanks again.

Edit: I found that if I generated a type library, things start to do something. Not the right thing, but something. I am pretty sure my code is wrong for doing what I want. I got it from a google search and other searches have much more complex ways of doing this more like what I described in an earlier post wher you convert each digit, then multiply by the power of that digit and then add then together. I would have thought this function would be built in though.

Right now the script is just passing decimal #s through and giving an error for a-f. Clearly not recognizing then as hex digits.


bwally,

Actualy there are hex digits at work in your Integra. 0-64 is hex for 0-100 decimal. What I am coming up against is that when I try to display this info on a touch panel controller (because the receiver in down in the basement). What makes thing interesting is that these digits are passed over the serial port in ASCII text so a value of "2c" in ASCII is actually 50 99 when the ascii is converted to decimal.

I could just convert the ascii string that comes from the Integra to a MLserver variable but as I mentioned before, you get a sequence that looks something like this:

00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 20 21 22 23 etc...

That would be fine for me, but the wife doesnt speak hex so she would not feel too comfortable with it I'm afraid.

Does this make any sense?
Regards,

John
User avatar
jpimentel
Expert
Expert
 
Posts: 591
Joined: Tue Feb 04, 2003 12:28 pm
Location: Waterford, WI

Postby jpimentel » Sun Jun 19, 2005 2:20 am

oops forgot the attachment... :oops:
Attachments
MLhex2dec.zip
(1.44 KiB) Downloaded 31 times
Regards,

John
User avatar
jpimentel
Expert
Expert
 
Posts: 591
Joined: Tue Feb 04, 2003 12:28 pm
Location: Waterford, WI

Postby bwally » Sun Jun 19, 2005 8:21 am

ahh, yes .... my mind plays tricks on me as i age.
i just pulled out the printed document (i couldn't seem to locate the PDF anymore ... it must be on the HD from the machine i'm rebuilding) ... and it clearly states:

3.3 Master Volume Command "MVL"
Commands to set or get the master volume.

Parameter List (Characters/Means):
"00"-"64" ... sets Volume Level 0 - 100 (In hexidecimal representation)


------------
yep, clear as day.
the documentation i have is for the TX-DS797/898/DTR-7.2/8.2
but i like this new spreadsheet you supplied much better!! thanks!!

i will have a bit more time to play with this after next weekend.

so, when we send "!1MVL0F[CR]" to the receiver it returns "!1MVL0F[EOF]" and sets the volume to 16 on the receiver. and what we need to do is get the last 2 characters in the return string before the [EOF] and convert them to a numeric value we can use.

is that the gist of it?
another steve
bwally
Intermediate
Intermediate
 
Posts: 364
Joined: Sat Aug 14, 2004 6:23 am
Location: ontario, canada

Postby jpimentel » Sun Jun 19, 2005 8:43 am

That is it precisely. :D
Regards,

John
User avatar
jpimentel
Expert
Expert
 
Posts: 591
Joined: Tue Feb 04, 2003 12:28 pm
Location: Waterford, WI

Postby bwally » Sun Jun 19, 2005 9:11 am

we will also have to extract the command, so we know which command the receiver is returning information about, so that the proper variable is being updated.

if someone walks up and manually turns that knob there will be a lot of data pushed across that serial port. and if the user selects a different input we will need to distinguish between "!1SLIxx" and "!1MVLxx" ... etc.
another steve
bwally
Intermediate
Intermediate
 
Posts: 364
Joined: Sat Aug 14, 2004 6:23 am
Location: ontario, canada

Postby jpimentel » Sun Jun 19, 2005 9:01 pm

bwally wrote:we will also have to extract the command, so we know which command the receiver is returning information about, so that the proper variable is being updated.

if someone walks up and manually turns that knob there will be a lot of data pushed across that serial port. and if the user selects a different input we will need to distinguish between "!1SLIxx" and "!1MVLxx" ... etc.


You are correct, but fortunately the most excellent generic serial plugin handles wildcards very nicely. If you simply tell it to look for !1MVL* with a termination character of decimal "26" (which is the EOF marker that Integra uses). The plugin will capture the volume data as desired. I have all this working already. All that is left is to convert the ascii string / hex value that comes back from the Integra to a nice neat deciaml # for display. I will attach a sample module with a few simple commands including the command that captures the volume.
Attachments
Integra Receiver.zip
(898 Bytes) Downloaded 34 times
Regards,

John
User avatar
jpimentel
Expert
Expert
 
Posts: 591
Joined: Tue Feb 04, 2003 12:28 pm
Location: Waterford, WI

Postby MurrayW » Mon Jun 20, 2005 3:43 pm

I am probably going to buy this TV -- Sharp LC-45GD6U AQUOS: http://www.sharpusa.com/products/ModelLanding/0,1058,1452,00.html

One of the selling points is that it has RS-232 two-way control. In the manual, there are two pages devoted to RS-232 information. Is the information presented in the attached images enough for me to use this plug-in or would I need to try to get more detail from Sharp in order to implement this.

The RS-232 documentation is on pages 95 and 96 of the manual:
http://www.sharpusa.com/files/tel_man_LC45GD6U.pdf
I tried to copy and paste the two pages into the attached files -- not sure how good they will come out.

thanks,

Murray
Attachments
Sharp RS-232.zip
(148.79 KiB) Downloaded 6 times
MurrayW
Is there life beyond Cinemar?
Is there life beyond Cinemar?
 
Posts: 1101
Joined: Sun Mar 07, 2004 1:05 pm
Location: Austin, TX

PreviousNext

Return to MLServer Plug-Ins

Who is online

Users browsing this forum: No registered users and 1 guest