Solved

Comms Control with internal modem

Posted on 2002-05-21
10
218 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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 50

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 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