Dial up and communicate with a machine use COM Port

The hardware is:
    1. PC connect to Modem using COM1, modem connect to
telephone line.
    2. The other side is a Machine (control by AT89c2051 microCPU) connect to modem using COM Port, the modem connect to telephone line.

I want to do this:
      The PC dial up to the Machine, and then communicate with
the machine using COM port.
      The PC and Machine only use three  signal lines (TX, RX,GND) to communicate with the modem.

I can communicate with the machine throght COM by RS-232
Direct connect line.

MY PC (WIN98,VB6, using MSCOMM control)

Can anybody tell me how to communicate with the machine
through modem?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

All you should have to to is send:

MSComm1.Output = "AT 555-1212" + VbCrLf

Where 555-1212 is the number you are dialing...

On the other side you have to send the following string to the modem:

ATS0= <number of rings to answer on>

For example, ATS0=3 will pick up the phone on the 3rd ring...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hxbAuthor Commented:
Thank for your help.

Please give me more detail suggestion.

The PC and the Machine communication in Binary mode.
As long as you set you communication line up for the right speed, parity, and stop bits, this is not going to be a problem...

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

hxbAuthor Commented:
       I tried, but there are l some problems.
 1.  When I send ATS0=3 , sometimes the modem not
     "OK", I have to try again,  How can I know if the mode is

 2.  The modem will send me some message trough
     Com1, such "CONNECT 9600"  "RING", If I receive data
    from the COM1, I will recieve these message.
    How can I set the modem to do not send these message,
    and let me only receive the data that sent by remote
Answer for #1:

Send "ATZ"+VbCrLf to modem before sending "ATS0=3"+VbCrLf

This will "reset" the modem before setting switch 0 to 3.

Answer for #2:

Your coded really needs to handle connect and ring messages, however, you can send:

"ATV0"+CbCrLf to the modem to turn verbose messages off.  Hayes message numbers will come back instead of connect and ring messages.

hxbAuthor Commented:
     Thank for your help, I try my best, but there are a lot
of problem.
     Can you give me a code like :
           1. Dial the Phone number
           2. Display dialing status like  
                 "NO DIALTONE", "BUSY", "NO ANSWER" "CONNECT"
           3. Let the user know that dial is OK
           4. When communicating, if the line is hangup or disconnect, Let the user know.

Can you help me?
I will increase the points if you can help me!


There is a complete sample project on how to use the MSComm Control on your visual basic CD.


It's a basic terminal package.

Hope this helps.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.