MScomm port

M

michael chan

HI experts,
I am a newbie of VB, and now come to some problem with
COM port programming.

I opened COM1 port with the command: MSComm1.PortOpen
= TRUE; and then send data via MSComm1.Output
= "something". On another computer, I opened the port to
which the input line is connected in the same manner, and
read the input with MSComm1.Input. However, nothing
happened when I started both program and tried to send
something.

I think there must be some critical steps or settings
I have missed. Any ideas? Please send emails to me:
(e-mail address removed)

Thanks so much. I am urgent about that.

Michael
 
O

One Handed Man

Well Henry,
Have you set the Baud Rate ( Line Speed ) of the com
port to be the same ?, also the number of Stop bits and Parity etc. Both
System speeds must match, and the connecting cable needs to be a crossover
Transmit toReceive , also, there are other signals to take care of DSR
should be Connected to DSR. to enable transmission.

Failing this, to test you could attach a voltmeter onto the Transmit Pin (
2 ) and ground ( 7 ) I think and see if the needle twiches at point of send.

HTH - OHM
 
D

Dick Grier

Hi,

Both ports must be open. Then, you send on the one computer and then (and
only then) execute the code on the receiving computer to Input data. The
easy way is to use OnComm receive processing (set RThreshold = 1). Thus, an
OnComm event or events are generated when data is received.

Also, make sure that you are using a null-modem cable or adapter to connect
your two PCs.

I have lots of working example code in my book (see below). Feel free to
ask specific questions, and I'll try to help out.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 

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

Top