vb.net - Serial Port read timed out visual basic -


i need read serial port parse incoming strings. if use putty can read strings in serial port if use vb application code, doesn't work:

private sub comportlist_selectedindexchanged(sender object, e eventargs) handles comportlist.selectedindexchanged     dim com1 io.ports.serialport = nothing     try         com1 = my.computer.ports.openserialport(comportlist.selecteditem, 9600)         com1.readtimeout = 10000                     dim incoming string = com1.readline()             if incoming isnot nothing                 msgbox(incoming & vbcrlf)             end if         loop     catch ex timeoutexception         msgbox("error: 'serial port read timed out.'") ' getting error             if com1 isnot nothing com1.close()     end try end sub 

i getting read time out error. code based on msdn documentation.

thanks in advance.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -