Visual Basic 6.0 and modem question

  • Thread starter Thread starter Ivan Seeking
  • Start date Start date
  • Tags Tags
    Visual
AI Thread Summary
The integration of a PC-based Visual Basic (VB) application with industrial computers is encountering issues related to modem disconnection. The VB routine successfully establishes a connection and retrieves data using the MSComm control, but fails to disconnect the modem afterward. The initialization string being used ("AT &D0 &R1 &B1") may be causing complications. Attempts to hang up the modem using the "+++" command to switch to command mode followed by "ATH0" have not been successful. The user is uncertain whether the issue lies within the VB code or the modem control commands, particularly since they are using a standard Hayes-compatible V90 modem. The problem persists despite efforts to manage the port state correctly.
Ivan Seeking
Staff Emeritus
Science Advisor
Gold Member
Messages
8,194
Reaction score
2,470
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
 
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Thread 'ChatGPT Examples, Good and Bad'
I've been experimenting with ChatGPT. Some results are good, some very very bad. I think examples can help expose the properties of this AI. Maybe you can post some of your favorite examples and tell us what they reveal about the properties of this AI. (I had problems with copy/paste of text and formatting, so I'm posting my examples as screen shots. That is a promising start. :smile: But then I provided values V=1, R1=1, R2=2, R3=3 and asked for the value of I. At first, it said...
Back
Top