Visual Basic 6.0 and modem question

  • Thread starter Thread starter Ivan Seeking
  • Start date Start date
  • Tags Tags
    Visual
Click For Summary
SUMMARY

The discussion centers on integrating a Visual Basic 6.0 application with a Hayes-compatible V90 modem for data retrieval. The user successfully establishes a connection using the MSComm control but encounters issues with modem disconnection. The initialization string "AT &D0 &R1 &B1" is suspected to interfere with the hang-up command "ATH0". The user attempts to switch to command mode using "+++", but this does not resolve the issue, indicating a potential problem with modem control rather than the VB code itself.

PREREQUISITES
  • Understanding of Visual Basic 6.0 programming
  • Familiarity with MSComm control for serial communication
  • Knowledge of modem initialization strings and commands
  • Experience with Hayes command set for modem control
NEXT STEPS
  • Research how to properly configure modem initialization strings for V90 modems
  • Learn about the MSComm control's properties and methods for effective port management
  • Explore troubleshooting techniques for modem communication issues in Visual Basic
  • Investigate the Hayes command set, focusing on commands for entering and exiting command mode
USEFUL FOR

Software developers working with legacy systems, particularly those integrating VB applications with modem communications, as well as anyone troubleshooting serial communication issues in industrial environments.

Ivan Seeking
Staff Emeritus
Science Advisor
Gold Member
Messages
8,252
Reaction score
2,664
I am having a first go at integrating a PC based VB application with some other types of industrial computers. I wrote a simple VB routine that calls up the driver [for the PC to Industrial connection] as an executable file. This all works fine. The program dials in, gets the data, and closes the exe with no problem. The problem is that whether or not I actually shell to the exe, the modem intialization string seem to be causing me problems. When I am done I can't get the modem to disconnect. This is what I am doing.

For dial out:

If MSComm1.PortOpen = False Then
Call mnuCommPortOpen_Click
End If

MSComm1.Output = "AT &D0 &R1 &B1" & vbCrLf
DialString = "ATDT" & DialNumber & vbCrLf
MSComm1.Output = DialString

Once it connects I set MSComm1.PortOpen = false. I need to do this to free up the port for the other application. After I retrieve the data, I attempt to hang up like this.

If MSComm1.PortOpen = False Then
MSComm1.PortOpen = True
End If


If MSComm1.PortOpen = True Then
MSComm1.Output = "+++" & vbCrLf
MSComm1.Output = "ATH0" & vbCrLf
MScomm1.Portopen = false
End If

My modem control skills really stink and I haven't worked with Basic in a very long time, so I'm not sure if this is a VB problem or a modem control problem. I thought that a simple ATH0 should do it, but something about the intialization prevents this from working. Then I thought that I must have to go back into command mode, so I added the +++, but no good. Does anyone know what's going on?

Edit: This all uses a standard Hayes compatible, V90 modem
 

Similar threads

Replies
8
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
10
Views
6K
Replies
3
Views
2K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 56 ·
2
Replies
56
Views
54K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 21 ·
Replies
21
Views
13K