Microcontroller_Lover
Newbie level 5
- Joined
- Jan 19, 2013
- Messages
- 8
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,342
Private Sub Timer1_Timer()
Dim inputBuffer As String
inputBuffer = MSComm1.Input
If inputBuffer = "RING" Then
Text3.Text = "Beep"
Beep
End I
[syntax=vb]
Private Sub Command1_Click()
If Text1.Text <> "" Then
MSComm1.Output = Text1.Text
End If
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
If data = "RING" Then
Text3.Text = "Beep"
End If
End If
End Sub
[/syntax]
but not working when incoming my module
[syntax=vb]
Private Sub Command1_Click()
If Text1.Text <> "" Then
MSComm1.Output = Text1.Text
End If
End Sub
Private Sub Form_Load()
MSComm1.Settings = "9600,N,8,1"
MsCOMM1.ComPort = 1
MSComm1.DTREnable = False
MSCOmm1.RTSEnable = False
MSComm1.Handshaking = 0
MSComm1.PortOpen = True
End Sub
Private Sub MSComm1_OnComm()
Dim data As String
If MSComm1.CommEvent = comEvReceive Then
data = MSComm1.Input
If data = "RING" Then
Text3.Text = "Beep"
End If
End If
End Sub
[/syntax]
Private Sub MSComm1_OnComm()
Static Buffer As String
t = Now() + timeout / 86400000#
If MSComm1.CommEvent = comEvReceive Then
Do
Text1 = Text1 + MSComm1.Input
If Now() > t Then Exit Do
Loop
Text3 = Text1
Text1 = ""
End If
str = Text3
str_1 = Mid(Text3, 1, 6)
Text4 = str_1
If (str_1 = "RING") Then
Text2.Text = Mid(str_1, 19, 13) 'Left$(str_1, 15)
ElseIf (str_1 = "+CMT") Then
Text5.Text = Mid(str_1, 19, 13) '19,13
Else
Exit Sub
End If
MSComm1.InBufferCount = 0
End Sub
Dim SearchString As String = " RING "
Dim SearchChar As String = "RING"
Dim TestPos As Integer
TestPos = InStr(SearchString, SearchChar, CompareMethod.Text)
Console.WriteLine("TestPos {0}", TestPos)
Private Sub MSComm1_OnComm()
Static Buffer As String
If (Text1 <> "") Then
Text1 = ""
End If
'Sleep 10
Dim Testpos As Integer
t = Now() + timeout / 86400000#
If MSComm1.CommEvent = comEvReceive Then
Do
Text1 = Text1 + MSComm1.Input
If Now() > t Then Exit Do
Loop
Text3 = Text1
End If
str_2 = "RING"
str_3 = "+CMT"
Testpos = InStr(1, Text3, "RING")
Text7 = Testpos ''''''-----------------------> Testpos number is 3<---------------------------
If (Testpos <> 0) Then
str = Trim$(Text3)
'str_1 = Mid(Text3, 1, 6)
str_1 = Left$(str, 6)
Text4 = str_1
If (str_1 = "RING") Then
'str = Left$(str, 19) 'Left$(str_1, 15) '-----------22,10------------
Text3 = Trim$(Text3)
str = Mid$(Text3, 19, 13)
Text2 = str
End If
End If
'Text2 = str
'----str_1 = Left$(str_1, 3)
'---- If (str_1 <> "+91") Then
'---- Exit Sub
'---- Else
'---- Text3 = Mid(str, 22, 10)
'---- End If
'Text1.SelStart = Len(Text1.Text)
'Text1.SelText = str_1
'MSComm1.InBufferCount = 0
'Text1 = ""
End Sub
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?