View Full Version : Help with reading data from Serial Port...

January 28th, 2008, 10:31 AM
Hello, I'm fairly new to girder... my apologies if what I'm asking has been explained elsewhere...

I'm trying to set up my video switcher to work as a remote control for the TV (switcher will accept component, S-Video, or composite inputs... and forward the signal to the proper port on my TV, though I still have to select the proper input on my TV - that's what I want to get rid of). I found this thread: http://www.promixis.com/forums/showthread.php?t=17664; and was able to get girder to respond when I hit one of the buttons on the switcher, though I get the following error:

Serial Error (CallLua): ...ram Files\Promixis\Girder\/plugins/serial/Extron.lua:32: bad argument #2 to `band' (number expected, got nil)

Using hyperterminal, I can receive the proper data from the switcher (i.e. "C1" is received when channel 1 is selected, C2 for channel 2 and on)... What do I need to change in the LUA file to properly receive the data? I attached the lua to this post...

Also, to confirm how I need to configure things, first I need to create the output event(s) desired, and then the input event(s) for each?


Rob H
January 28th, 2008, 08:38 PM
Try changing the ReceiveResponse method in the Extron.lua file from

ReceiveResponse = function(self, data, code)
gir.TriggerEvent(math.bytetohex(data), 82) -- you may want to change the 18 to another number - see the thread on TREESCRIPT DUI Page Registry

Super.ReceiveResponse(self, data, code) -- must call the parent's ReceiveResponse


ReceiveResponse = function(self, data, code)
if math.band(code, serial.RXCHAR) > 0 then
gir.TriggerEvent(math.bytetohex(data), 82)
Super.ReceiveResponse(self, data, code)