Solved

Comms Control with internal modem

Posted on 2002-05-21
10
197 Views
Last Modified: 2012-05-04
Hi, I'm having trouble getting the MScomm32 control to work with my internal Swann modem. My Modem thinks it's on com3(atleast the modem driver does anyway), however a quick look in the ports section of the device manager tells me that physically com3 doesn't actually exsist, but there is a Swann internal modem Emulator.

So the question is, what do I set the MSComm1.Commport property to get it to work with the modem?  -Thanks

Regards
/GavinS
0
Comment
Question by:GavinS
10 Comments
 
LVL 1

Expert Comment

by:barendb
ID: 7026520
Have you tried to set it to COM 3?

Barend
0
 

Author Comment

by:GavinS
ID: 7028388
Yeh, I've tried com3, but modem doesn't respond to any AT commands. Here's the program I used to test the modem.

Private Sub Command1_Click()
   Dim strCommand as string

   Comm1.Commport=3
   Comm1.portopen=TRUE
   strString="ATDT12345"
   Comm1.output=strString
   strString=ATH
   comm1.output=strString
   Comm1.portopen=FALSE
end sub

I suspected that because there was no comm3 port listed in the device manager, this maybe why the MScomm control was not working?

/GavinS
0
 
LVL 1

Expert Comment

by:barendb
ID: 7029022
Try testing the port with Hyperterminal, connect directly to the port and type the AT commands, you will see the response.  I don't see any code in there that checks your in buffer.  Are you using the OnComm event, if so are you sure that your properties are set right so that the event fires.
0
 

Author Comment

by:GavinS
ID: 7031915
Hi barendb, I tried hyperterminal and I can send AT commands to the modem on Comm3 OK and the modem reponds correctly.

As a point of interest, it has occured to me that if the MSComm control didn't recognise comm3 then it would generate an error when I called the portopen method. Since this is not happening then I should assume that the Comm3 port is being opened successfully.  Which raises the question, why doesn't modem respond to the above test app? Hhmmm

/GavinS
0
 
LVL 1

Expert Comment

by:barendb
ID: 7032234
Set your RThreshold property to 0 and Inputlen property to 0.  Send the AT command using output property, wait for about a second and then query input.  see if you get anything back.
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:GavinS
ID: 7057766
Hi barendb,
Sorry I took so long to reply, I've been away for a while. I tried setting RThreshold to 0 and trapped the comEvReceive in the OnComm event, but the modem is definately not replying with anything. I also check the InBufferCount, but this was set to 0, indicating that so data was received by the comms control

/GavinS
0
 
LVL 1

Expert Comment

by:barendb
ID: 7058649
Gavin,

I'll have to go look at my code at home, I remember having the same kind of problem talking to some other hardware, but I cannot remember how I solved it.  It was a couple of years ago, I'll go have a look and let you know.

Barend
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 7162493
Hi GavinS,

Ensure that you have this properties values set for your MSComm object:

.Handshaking = 0
.RThreshold = 1
.SThreshold = 1
.NullDiscard = True
.RTSEnable = True
.DTREnable = True

Good luck,

Vitor Montalvao
0
 

Author Comment

by:GavinS
ID: 7173223
Hi All, I've been a bit distracted from this problem lately, but I finally fixed it. All I needed to do was terminate the dialing string with a carrige return.

  strString="ATDT12345" & vbCrLf
  Comm1.output=strString

Thanks to all for your advice/assistance. What do I do with this question now?

/GavinS
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 7278331
Points refunded and placed in PAQ

Computer101
E-E Moderator
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now