Microcontroller_Lover
Newbie level 5
I use SIM900D module and interface it use software. I write that software code use VB 6.0. But I face a problem. If a incoming call in my gprs module that time my module send “RING” string. I see it a text box. But I want to do that when my RS232 receive “RING” that time does something like as Beep. My software work normally but when my module send “RING” that time code not working. What is problem?
Here my code:-
Private Sub Command1_Click()
MSComm1.Output = Text1.Text & Chr(13)
End Sub
Private Sub Form_Load()
MSComm1.PortOpen = True
MSComm1.Settings = "9600,n,8,1"
MSComm1.DTREnable = False
End Sub
Private Sub MSComm1_OnComm()
Dim data As String
If MSComm1.CommEvent = comEvReceive Then
data = MSComm1.Input
End If
End Sub
Private Sub Timer1_Timer()
Dim inputBuffer As String
inputBuffer = MSComm1.Input
If inputBuffer = "RING" Then
Text3.Text = "Beep"
Beep
End If
Text2.Text = Text2.Text & Chr(13) & inputBuffer
If (LCase$(inputBuffer) = "0") Then
Chr (13)
End If
End Sub
View attachment Corrected serial communication with beep.rar
Here my code:-
Private Sub Command1_Click()
MSComm1.Output = Text1.Text & Chr(13)
End Sub
Private Sub Form_Load()
MSComm1.PortOpen = True
MSComm1.Settings = "9600,n,8,1"
MSComm1.DTREnable = False
End Sub
Private Sub MSComm1_OnComm()
Dim data As String
If MSComm1.CommEvent = comEvReceive Then
data = MSComm1.Input
End If
End Sub
Private Sub Timer1_Timer()
Dim inputBuffer As String
inputBuffer = MSComm1.Input
If inputBuffer = "RING" Then
Text3.Text = "Beep"
Beep
End If
Text2.Text = Text2.Text & Chr(13) & inputBuffer
If (LCase$(inputBuffer) = "0") Then
Chr (13)
End If
End Sub
View attachment Corrected serial communication with beep.rar