dim timercnt as integer=10 ' ten seconds timeout
dim timer1 as timer
timer1.initialize("timer1",1000)
timer1.enabled=true
Sub AStreams1_NewData (bufferx() As Byte)
Dim msg As String
timercnt=10
msg = BytesToString(bufferx, 0, bufferx.Length, "ISO-8859-1")
'process msg
end sub
sub timer1_tick
if timercnt>0 then
timercnt=timercnt-1
if timercnt=0 then callsub "whateveryouwant" ' process timeout
end if
end sub