Bluetooth Serialport / Timeout problem

  • Thread starter Thread starter Michael Kugler
  • Start date Start date
M

Michael Kugler

Hi,

i've got problems sending data to a Zebra RW420 via bluetooth serialport. I
get a timeout after 8 lines. timeout is set to -1
The code is like this.:

Me.SerialPort1.PortName ="COM6"
Try

Me.SerialPort1.Open()

Me.SerialPort1.Write("! U1 JOURNAL" + Chr(13) + Chr(10))

Me.SerialPort1.Write("! U1 IN-MILIMETERS" + Chr(13) + Chr(10))

Dim counter As Integer

For counter = 1 To 15

Me.SerialPort1.Write("! U1 SETLP 4 0 47" + Chr(13) + Chr(10))

Me.SerialPort1.Write("Printer Test" + Chr(13) + Chr(10))

Next

If Me.SerialPort1.IsOpen Then

Me.SerialPort1.Close()

End If

Catch ex As Exception

MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error")

End Try


--
---
Mit freundlichen Grüßen / Yours sincerely ,

Michael Kugler


Compunited
Inh.: Michael Kugler
Hasellohweg 19
90766 Fürth
Germany

Tel +49(911)1327142
Fax +49(911)1327143

Cell Phone +49(162)2656942
 
Hi Michael,

Just set the erite timeout property to some other value or don't call SerialPort.Close
right after writing the data to the port; either wait some time to ensure
all the data is sent over the bluetooth link or call close somewhere else,
when you are sure the data has been sent.

Cheers,

Alejandro Mezcua
MVP .NET Compact Framework
http://www.byteabyte.net/
 
Hi Alejandro,

Thank you. i've set the timeout to 10000 and it works.

cheers

Michael
 
Back
Top