PDA

View Full Version : Serial send error (SendCommand = a nil value)



VSDomotics
December 16th, 2007, 09:45 AM
I sometimes get the following errors. The serial then just stops working.



Timer (pcall): H:\Girder\Program\/plugins/serial/init.lua:446: attempt to index field `LastCommand' (a nil value)
stack traceback:
H:\Girder\Program\/plugins/serial/init.lua:446: in function `SendCommand'
H:\Girder\Program\/plugins/serial/ICPCON.lua:45: in function `QueryAD'
[string "VSH:\Init\On Open\F:ICPCON Processing"]:3: in function `CheckAD'
[string "VSH:\Init\On Open\F:Timers"]:3: in function `TIM1commands'
[string "Timer/OnTrigger"]:1: in main chunk
Serial Error (CallLua): H:\Girder\Program\/plugins/serial/init.lua:450: attempt to index field `LastCommand' (a nil value)
stack traceback:
H:\Girder\Program\/plugins/serial/init.lua:450: in function `SendCommand'
H:\Girder\Program\/plugins/serial/init.lua:478: in function `SendQueCheck'
H:\Girder\Program\/plugins/serial/init.lua:501: in function `ReceiveResponse'
H:\Girder\Program\/plugins/serial/ICPCON.lua:40: in function <H:\Girder\Program\/plugins/serial/ICPCON.lua:33>
Serial Error (CallLua): H:\Girder\Program\/plugins/serial/init.lua:491: attempt to index field `LastCommand' (a nil value)
stack traceback:
H:\Girder\Program\/plugins/serial/init.lua:491: in function `ReceiveResponse'
H:\Girder\Program\/plugins/serial/ICPCON.lua:40: in function <H:\Girder\Program\/plugins/serial/ICPCON.lua:33>
Serial Error (CallLua): H:\Girder\Program\/plugins/serial/init.lua:491: attempt to index field `LastCommand' (a nil value)
stack traceback:
H:\Girder\Program\/plugins/serial/init.lua:491: in function `ReceiveResponse'
H:\Girder\Program\/plugins/serial/ICPCON.lua:40: in function <H:\Girder\Program\/plugins/serial/ICPCON.lua:33>
nil
Timer (pcall): H:\Girder\Program\/plugins/serial/init.lua:491: attempt to index field `LastCommand' (a nil value)
stack traceback:
H:\Girder\Program\/plugins/serial/init.lua:491: in function `ReceiveResponse'
H:\Girder\Program\/plugins/serial/ICPCON.lua:40: in function `ReceiveResponse'
H:\Girder\Program\/plugins/serial/init.lua:338: in function <H:\Girder\Program\/plugins/serial/init.lua:333>


Before this happens the serial device worked fine for hours.

It seems the 'LastCommand' table gets erased. How could this be happening? I don't use myself the LastCommand variable somewhere else in my code. Who or what is erasing this table? Or is it something different?

Rob H
December 16th, 2007, 10:46 AM
I've seen this here myself - try this version of serial\init.lua which may have fixed it. But make a backup of your existing one, since this one is actually from my G5 install.

VSDomotics
December 16th, 2007, 12:41 PM
I'll give it a try soon. By now I changed the driver from qued to simple. Perhaps that solves my problem too (did not expect an answer this soon).