PDA

View Full Version : Generic Serial Plugin - Ignore Source for 0.2Sec?



Krobar
September 24th, 2005, 08:21 AM
Hi,

Im using Girder with the Generic Serial plugin to Automate my HT setup. It recieves an event from Serial device A which triggers the appropriate command to send to Serial device B. The trouble is Device A sends a complete status after some events which causes havoc. How can I ignore anything from Device A for say 0.2seconds after it has triggered a command? (Something I could apply per command would be great)

My other question is vaguely related. Device A will send its volume in the form "VolXX" XX=0-99. Is it possible to write a little code to send "Volume = XX" to Device B when this happens?

Promixis
September 24th, 2005, 08:37 AM
Will anti repeat work?

Krobar
September 24th, 2005, 09:09 AM
OK after some experimentation I have found a way to solve the Status report problem. I setup a multi command group for each event string that causes a status report from Device A. The group issues the appropriate command to device B and then disables the group that contains all the commands that can be triggered by the status report. A seperate command is triggered by the final RS232 command given by Device A in its status reports that enables the disabled group.

Im still stuck on the volume problem though. Can anyone help?

Krobar
September 24th, 2005, 09:13 AM
Hi Mike,

I posted the soultion I found for that problem above at nearly the same time as your question, anti repeat would not work because the status report would trigger different commands. I tried a 1 second delay in the Serial setup for output to Device B but that just caused a slow succession of commands I did not want caused by the status report.

Do you know of any possible solutions to the volume problem?

Promixis
September 24th, 2005, 09:35 AM
yes, you can easily parse that using lua.

something like


local volume = strsub (pld1,4,-1)

print (volume)

then you need to send it..

either trigger an event or use the serial:send

Krobar
September 25th, 2005, 02:13 AM
Hi Mike,

Thanks for the code, sorry if this is a stupid question but I have never used LUA and I was wondering if you had any LUA links specifically for Girder and the Serial plugin.

I have had a look at the tutorial linked in the sticky and although it all seems very logical (Kinda similar to VB) I dont know how to use it with Girder or the serial plugin. The related Onkyo DS989 file in downloads was no help either.

What I'm trying to accomplish is to get my Video Processor/Switcher (A Lumagen HDP) to display information from my Integra Surround Processor. For a long time I have used Girder to bind inputs on the Lumagen to those on the Integra, (eg. Press DVD input on Integra to change sound input and Lumagen switches to appropriate video input). Recently Lumagen added support for printing messages to screen which means alot more is possible, I already have surround modes and muting being reported on screen but reporting volume is proving more difficult. I'm quite happy to share my Girder file as a code example if it is of use to anyone, it should work with all Lumagen products and all Onkyo/Integra Recievers/Surround Processors which have an RS232 Connection.

Promixis
September 25th, 2005, 06:03 AM
lua.org has a lot of info on lua and related links.

then the serial readme is very good.

G4 has an awesome manual and documentatiion. But the switch won't be painless.

Krobar
September 26th, 2005, 12:14 PM
Thanks Mike,

Im trying to get my head round the required code. Heres what I want to do:
1) Serial Device "Integra" sends "!1MVLXX" to Girder
2) Girder Sends "ZT0Volume = XX{" to Serial Device "Lumagen"

Here is the code I have so far:
Volume = strsub(pld1,5)
SERIAL_SendData( Lumagen, "ZT0Volume ="..Volume)

My trouble is Im not really sure how to trigger the above, probably because I lack understqanding of the pldX variables. Do you have any pointers on this?

Promixis
September 26th, 2005, 12:20 PM
if its the lua script action you want to trigger, you will need to add the serial event to it. from top right hand corner select the device and click learn.

Krobar
September 26th, 2005, 12:32 PM
Because the volume number varies, can I use wild cards eg. "!1MVL**" or trigger on the first part of the command somehow?

Does the little bit of script below look OK?

Promixis
September 26th, 2005, 12:35 PM
sciprt looks ok, use a few print statments to make sure.

the events do not allow for wild cards. you can use luaevents plugin to make event handlers in lua that can do this.

G4 allows for wildcard lua event handlers.

Krobar
September 28th, 2005, 08:33 AM
Is there some where I could put an if statement that could be run on every input?

Eg:
If strsub(pld1,-2) = "!1MVL" then
Volume = strsub(pld1,5)
SERIAL_SendData( Lumagen, "ZT0Volume ="..Volume)
End

Promixis
September 28th, 2005, 08:46 AM
yes,

top right hand corner, select girder event, select on all.

you can also get all serial events this way.

Krobar
September 30th, 2005, 03:44 AM
H Mike,

I tried your code from earlier but Girder simply reports "Result=0". The problem seems to be with the the pld1 reference since if I just print that I get exactly the same. Am I doing something wrong?

Promixis
September 30th, 2005, 08:42 AM
include you code again.

Krobar
October 7th, 2005, 07:50 AM
Something as simple as "print (pld1)" does not work. It does not error but just gives a Result=0 response. I dont really understand the pld values and I suspect this is where the trouble may be.

Promixis
October 7th, 2005, 10:22 AM
hm, then pld1 is probably empty...

you could try

print ('payload 1',pld1)

to make sure the command is being executed.