Problem with Data Transfer over Telephone Line through Modem using VB6.0.

R

Thread Starter

ravi

Respected Sir,
I am trying to Transfer Data over Telephone Line through Modem. Following is some Technical Information that I’m currently using.

- VB6.0 and MSComm Control 6.0
- All Default Property Values of MSComm Control has been used.
- My Modem is “ MR56PVS-RSI 56K Speakerphone PCI Modem ”
- I’m Issuing Hayes Command (i. e. AT Commands) to my Modem. Also, Default Settings of modem are not disturbed.
- Also, the contents of Input Buffer of MSComm control are being displayed in a simple Label Control. Note that I’m using a Timer control, with delay of 1 Second, which fetches Input Buffer of MSComm Control and sends to label control for display.

But During Testing I’m facing some Problem. Let’s call “MR56PVS-RSI 56K Speakerphone PCI Modem” as Modem-A and Remote modem as Modem-B.
Here is how it goes -

Situation I -
Modem-A calls Modem-B by dialing appropriate Telephone Number (ATDT XXXXXX)
Modem-B receives the Ring & responds to Modem-A by using command ATA.
While the Two Modems Do the Handshaking I can hear (at both places) the typical weird noise coming from Modem’s Speaker. After some time I get the “Connect 9600” message at both the Modems.
Now, Modem-B sends some message to Modem-A. Modem-A can successfully receive this message in the Input Buffer of MSComm Control and message is displayed in label control that I’m using.
But, the problem lies here. Modem-A now tries to send some message to Modem-B. But I can’t see any message at Modem-B’s MSComm Control-Input Buffer. I also can’t see any disconnected message or “No Carrier” message from both the modems, meaning connection is OK.

Note - By ‘Modem-A or B doing some action’, I mean my VB application issuing AT command to Modem-A or B. I’m using Same VB application at both Ends. I’m using a Textbox Control where AT commands can be entered, thereby allowing me to give AT-commands Dynamically.

Situation II -
Now the Roles of both modems has been Interchanged. Here Modem-B is caller and Modem-A is receiver. But In both situations only Modem-A is unable to send any message Or may be Modem-B is unable to receive any message but can send successfully.
I am looking for a solution, which will enable me to communicate in both directions. Your co-operation is highly appreciated.
Thanking you,
Ravi
From : [email protected]
 
D
Each PC must send an AT command eg ATI to its Modem. This allows the modem to determine what baud rate, parity etc is used between the modem and the PC. So at the start of the Visual Basic program for both PC's send an ATI to the modem.
 
J

John Waalkes

From what I can guess, it sounds like your modem connection is setting itself up in half-duplex mode (rather than full-duplex).

Full-duplex allows you to communicate in *both* directions simultaneously.

Half-duplex allows you to communicate in both directions, but only in one direction at a time (and to complicate this, to transmit in the other direction, you have to tell the modems to "turn the lines around" so that you can talk in the other direction).

I'm guessing that for some reason your modems are connecting at a half-duplex speed during the "negotiation" phase. Bad phone lines? Error in your modem init string?

Here's some light reading on Visual Basic & serial communications

"http://www.bb-elec.com/books/vbpgtoc.asp":http://www.bb-elec.com/books/vbpgtoc.asp

And here's your basic "Hayes-compatible" technical reference.

"http://www-dcg.fnal.gov/Net/HYSTRM20.TXT":http://www-dcg.fnal.gov/Net/HYSTRM20.TXT

And I would recommend the linux "Modem-HOWTO" (even though you are not using linux).

"http://www.tldp.org/HOWTO/Modem-HOWTO.html":http://www.tldp.org/HOWTO/Modem-HOWTO.html

I would look at the part following: "B - Select Communication Standard"

and take a look at what the "B60" command does.

And for what you want to do (based on the speed that you gave me), you will want to select V.32/V.32bis mode (this is the "Command Group 8, B60" command that I pointed you to). This gives you 9600 baud, full-duplex transmission.

I think that this is setup using the S37 register.

Yup, I found this over at:
"http://www.dynalink.com.au/support/atcommands.htm":http://www.dynalink.com.au/support/atcommands.htm

"Use S37=x, with x being one of the following (e.g. to lock the modem to 9600 baud, use ATS37=9)::

1-3 = Attempt to connect at 300 bps.
5 = Attempt to connect at V.22 1200 bps.
6 = Attempt to connect at V.22 bis 2400 bps.
7 = Attempt to connect at V.23.
8 = Attempt to connect at V.32 bis/V.32 4800 bps.
9 = Attempt to connect at V.32 bis/V.32 9600 bps
10 = Attempt to connect at V.32 bis 12000 bps.
11 = Attempt to connect at V.32 bis 14400 bps.
12 = Attempt to connect at V.32 bis 7200 bps."

So you would want to use "ATS37=9" at both ends


And here are a few news sites:

comp.dcom.modems -- modems & comm software.
comp.sys.ibm.pc.hardware.comm -- comm hardware.

Good luck, I hope this helps :)

John
 
Top