Visual Basic 6.0 and modem question

  • Thread starter Ivan Seeking
  • Start date
  • Tags
    Visual
In summary, the conversation discusses the integration of a PC based VB application with industrial computers. The speaker has written a routine that calls up a driver for the connection and it works well. However, they are having trouble disconnecting the modem after retrieving data. They have attempted different methods, but it seems to be a problem with the modem initialization string or compatibility with the modem itself. They are seeking advice and suggestions on how to resolve the issue.
  • #1
Ivan Seeking
Staff Emeritus
Science Advisor
Gold Member
8,142
1,759
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
 
Computer science news on Phys.org
  • #2
It sounds like you may be having an issue with your modem initialization string. Have you tried different initialization strings? It could be that some of the settings in your string are conflicting with each other, so that's something to look into. Additionally, double check that you are using a Hayes compatible, V90 modem, as this may play a role in the success or failure of the disconnection. Good luck!
 
  • #3
It seems like you are on the right track by using the AT commands to control the modem. However, it's possible that the modem initialization string you are using is not allowing the modem to properly disconnect. I would recommend checking the documentation for your specific modem to see if there are any specific commands or settings that need to be used for disconnection. Additionally, you may want to try using a different modem initialization string or even trying a different modem altogether to see if that solves the issue. It's also possible that there could be a problem with the VB code itself, so you may want to double check that as well. If all else fails, it may be helpful to consult with a more experienced VB programmer or a modem expert for further assistance.
 

Related to Visual Basic 6.0 and modem question

1. What is Visual Basic 6.0?

Visual Basic 6.0 is an object-oriented programming language developed by Microsoft. It is used for creating Windows applications with a graphical user interface (GUI).

2. Is Visual Basic 6.0 still supported?

No, Visual Basic 6.0 is no longer supported by Microsoft. It was officially retired in 2008 and is no longer receiving updates or technical support.

3. What is a modem?

A modem is a device that allows a computer to connect to the internet or other networks using a telephone line or cable connection. It modulates digital signals from a computer into analog signals that can be transmitted over a telephone line, and demodulates analog signals back into digital signals for the computer to understand.

4. Can Visual Basic 6.0 be used to control a modem?

Yes, Visual Basic 6.0 has built-in functionality for controlling modems and sending and receiving data over a telephone line. This can be useful for tasks such as sending faxes or connecting to the internet.

5. Is it possible to create a program in Visual Basic 6.0 that dials a phone number through a modem?

Yes, with the appropriate code and modem settings, it is possible to create a program in Visual Basic 6.0 that can dial a phone number through a modem. This can be used for automated tasks such as making phone calls or sending automated messages.

Similar threads

Replies
8
Views
2K
Replies
10
Views
2K
  • Computing and Technology
Replies
8
Views
2K
Replies
2
Views
983
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Art, Music, History, and Linguistics
Replies
1
Views
1K
  • Programming and Computer Science
Replies
2
Views
3K
  • Electrical Engineering
2
Replies
56
Views
51K
  • Electromagnetism
Replies
1
Views
2K
Back
Top