Okay, here's my problem. I'm trying to contact a remote system via a modem. It works fine when I dial the site up through hyperterminal, but from code I never get any data back.
Here's some of my test code.
When I dial a number using, e.g., "ATDT 9,555-1234", the modem seems to connect. It echoes back the dialing command and gives me a message saying "CONNECT 1200/NONE" and the onComm event registers a carrier detect change. However, after that, nothing happens. I can send as much data as I want, but I never get anything back. Normally (through hyperterminal) I send 2 carriage returns and then I get a sign on prompt, but through code, I can send them all day and I don't get a thing back. I can issue the modem a "+++" to drop it back into command mode, after which it will give me output, so I know it's functioning, but while it's active I get nothing.
What's going on here? Can anyone give me any tips/ideas? Is there some key setting that I'm just missing? Anything? I've never done any serial communications before, and I'm starting to get desparate.
Here's some of my test code.
Code:
Private Sub Form_Load()
' Set up the control with the right settings and open the port.
With MSComm1
.Settings = "1200,n,8,1"
.CommPort = 1
.PortOpen = True
.InputLen = 0
End With
End Sub
Private Sub Command1_Click()
' Allows me to dial, send commands, etc.
' There's also a button that does the same thing,
' but with no carriage return after the string
Dim str As String
str = Text2.Text & Chr$(13)
MSComm1.Output = str
End Sub
Private Sub Timer1_Timer()
' Lets me keep track of the input recieved.
' I have a similar statement in the onComm event.
Text1.Text = Text1.Text & MSComm1.Input
End Sub
What's going on here? Can anyone give me any tips/ideas? Is there some key setting that I'm just missing? Anything? I've never done any serial communications before, and I'm starting to get desparate.