Bluetooth Serialport / Timeout problem

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
 
A

Alejandro Mezcua

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/
 
M

Michael Kugler

Hi Alejandro,

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

cheers

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top