Search code examples
modem

How to configure modem?


I wrote program in Visual C++ 2008 for communication trough RS-232 between computer and industrial machine. Program works fine when computer and machine are connected directly trough RS-232 cable.

Now I want to communicate through modems.

I have two 56K modems (TDW-33). First modem is connected through RS-232 cable to PC. Second modem is connected to the machine (trough RS-232) that receive commands from computer and answer on this commands. The modems are connected through telephone line.

How to configure two modems to work correctly? Do I need to change my C++ code?


Solution

  • You are really bringing back memories...

    You control modems by writing character sequences to the RS-232 serial port. The exact commands depend on your particular modem. Almost all modems at least understand a common subset of commands known as the Hayes Commands. Wikipedia provides a good overview of the commands along with some history:

    http://en.wikipedia.org/wiki/Hayes_command_set

    For example, to dial the number 2345678 you would send the command

    ATDT2345678

    You would configure the receiving modem to answer an incoming call with the command

    ATA

    or you could configure the receiving modem to always answer after, say, 3 rings with

    ATS0=3