Ok Thanks
I did try AsyncStreams but the program stopped as soon as I tried to connect to a bluetooth connection.
I will probably investigate the program again.
as my project totally revolves around the blue tooth , I did the following with the serial example, and if works for my requirements.
'Activity module
Sub Process_Globals
Dim Serial1 As Serial
Dim tmpin As InputStream
Dim tmpout As OutputStream
Dim bufin(1023),bufout(1023) AsByte
End Sub
Sub Serial1_Connected (Success AsBoolean)
If Success Then
tmpin=Serial1.InputStream 'connect streams to input and output streams in program
tmpout=Serial1.OutputStream
connected = True
' this section writes bytes to bluetooth
tmpout.WriteBytes(bufout,0,7)
this section reads from bluetooth but waits using doevents
'main loop
DoWhileconnected = True
'first wait for serial data
DoWhile bytenum = 0
bytenum= tmpin.BytesAvailable
DoEvents
Loop
Timer1.Enabled=True 'wait 20 ms , and read buffer
DoWhileTimer1.Enabled=True
DoEvents
Loop
'then read serial info
byteread=tmpin.ReadBytes(bufin,0,bufin.length)