How to listen from the COMport (AxMsCommLib , Vb.net)

  • Thread starter Thread starter savvaschr
  • Start date Start date
S

savvaschr

Hello
I am using the output method of
AxMsCommLib of vb6 in vb.net to send things
on the com port and it works just fine

Is there a way to get - Listen the com port too by using this
object (AxMsCommLib) ? Or any Other object in vb.net

Thanks a lot
Savvas
 
Hi,

You enable OnComm receive events by setting RThreshold = 1. OnComm events
will be generated when one (or more) characters are received. You add code
in the OnComm event handler subroutine to process the data. Make sure that
you set RTSEnable = True -- many devices require that RTS be high before
they send data.

I have lots of examples in my book (see below) that might be helpful -- and
you might want to download DesktopSerialIO from my homepage, which is a
native .NET dll that you may find to be easier to deploy than MSComm.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 
Ok i did this,
But in order for the onComm event to raise i call the input method not
the output,

Anyway what code shall i write in the onComm event in order to take the
answer back from the serial port ?
Can ianyone help please??

Thanks in advance
Savvas
 
Back
Top