No Response?

tommy_121314
12-16-2001, 12:29 AM
Hi to all experts,
I think i am driven crazy by the MSComm32
I am wondering why I just can't receive the response from my
modem.

Can any body tell me whats wrong with my codes?
Thanx for any helps and suggestions

Option Explicit
Dim buffer As String

Private Sub cmdOpenClose_Click()
If comm.PortOpen = True Then
comm.PortOpen = False
optCom1.Enabled = False
optCom2.Enabled = False
stsPort.SimpleText = "Port Status : Close"
Else
comm.PortOpen = True
optCom1.Enabled = False
optCom2.Enabled = False
stsPort.SimpleText = "Port Status : Open"
End If
End Sub

Private Sub cmdSend_Click()
Dim cmd As String
If comm.PortOpen = False Then
comm.PortOpen = True
optCom1.Enabled = False
optCom2.Enabled = False
stsPort.SimpleText = "Port Status : Open"
End If
cmd = txtCmd.Text & vbCr
comm.Output = cmd
txtCmd = ""
tmSts.Enabled = True
stsPort.SimpleText = "Port Status : " _
& "sending command : " & cmd
End Sub

Private Sub comm_OnComm()
tmSts.Enabled = True
stsPort.SimpleText = "Port Status : receive event"
Select Case comm.CommEvent
Case comEvReceive:
Do While comm.InBufferCount > 0
buffer = comm.Input
txtResponse = txtResponse & buffer
txtResponse = txtResponse & vbCrLf
Loop
Break
End Select
End Sub

Private Sub Form_Unload(Cancel As Integer)
If comm.PortOpen = True Then
comm.PortOpen = False
End If
End Sub

Private Sub optCom1_Click()
comm.CommPort = 1
End Sub

Private Sub optCom2_Click()
comm.CommPort = 2
End Sub

Private Sub tmSts_Timer()
If comm.PortOpen = True Then
stsPort.SimpleText = "Port Status : Open"
Else
stsPort.SimpleText = "Port Status : Close"
End If
tmSts.Enabled = False
End Sub

Ales Zigon
12-16-2001, 03:02 AM
Is your modem internal or external one?
If internal then I think it is not located either on com1 or com2 but on the slot somewhere (com3, com4,...).
I'd suggest running the control panel and check it out.

divil
12-16-2001, 05:18 AM
I'd say the most likely thing here is you need to set the RThreshold property of the control to 1.

tommy_121314
12-17-2001, 06:38 AM
Hey, thank you very much. finally it can work.
RThreshold is really something which is important and yet i missed it for days. Without you probably I would be scratching my head for months over that.

divil
12-17-2001, 08:05 AM
That'll be £50 please.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum