Dim message, mess As String
Dim sms() As String
Dim sm() As String
Dim lat, lon, d1, d2 As String
Dim lat1, lon1 As Double
Dim lt1, ln1 As Double
Dim u, loc, s, n, msg, ms, tid, tre, mob As String
Dim i As Integer
Dim temp, t, l, g, o, e, result As Double
Dim h() As String
Dim k() As String
Private Sub Combo1_Click()
MSComm1.CommPort = Combo1.Text
End Sub
Private Sub Command1_Click()
If MSComm1.InBufferCount > 0 Then
u = MSComm1.Input
Text1.Text = Text1.Text & us = Mid(u, 2, 4)
n = Mid(u, 13, 1)
If Mid(u, 2, 4) = "CMTI" Then
loc = Mid(u, 13, 1)
MSComm1.Output = "AT+CMGR=" & loc & Chr(13)
Text1.Text = Text1.Text & "AT+CMGR=" & loc & Chr(13)
Text1.Text = MSComm1.Input
message = Text1.Text
'message = "@0996.54553,N,07630.23133449,E,@0968.5172,N,07639.4825,E"
message = "@0997.9844,N,07660.2006,E,@0968.5172,N,07639.4825,E"
sms() = Split(message, "@")
mess = sms(1)
sm() = Split(mess, ",")
lat = sm(0)
convert (lat)
lat1 = resultl
t1 = lat1
d1 = sm(1)
lon = sm(2)
convert (lon)
lon1 = result
ln1 = lon1
d2 = sm(3)
Dim stAppName As String
Create KML FILE:
Dim path As String
Shell """C:\Program Files\Google\Google Earth\GoogleEarth.exe"" ""C:\Program Files\Google\Google Earth\ret.kml"""
End Sub
Private Sub Command2_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456FORWARD" & Chr(26)
End Sub
Private Sub Command3_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456RIGHT" & Chr(26)
End Sub
Private Sub Command4_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456LEFT" & Chr(26)
End Sub
Private Sub Command5_Click()
MSComm1.PortOpen = True
End Sub
Private Sub Command6_Click()
MSComm1.PortOpen = False
End Sub
Private Sub Command7_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456PULLY" & Chr(26)
End Sub
Function convert(val As String)
temp = val
h() = Split(temp, ".")
t = h(0)
l = t / 100
n = h(1)
k() = Split(l, ".")
g = k(0)
o = k(1)
e = o + n
result = g + "." + e
End Function
Private Sub Timer1_Timer()
If MSComm1.InBufferCount > 0 Then
Text1.Text = MSComm1.Input
End If
End Sub
Dim sms() As String
Dim sm() As String
Dim lat, lon, d1, d2 As String
Dim lat1, lon1 As Double
Dim lt1, ln1 As Double
Dim u, loc, s, n, msg, ms, tid, tre, mob As String
Dim i As Integer
Dim temp, t, l, g, o, e, result As Double
Dim h() As String
Dim k() As String
Private Sub Combo1_Click()
MSComm1.CommPort = Combo1.Text
End Sub
Private Sub Command1_Click()
If MSComm1.InBufferCount > 0 Then
u = MSComm1.Input
Text1.Text = Text1.Text & us = Mid(u, 2, 4)
n = Mid(u, 13, 1)
If Mid(u, 2, 4) = "CMTI" Then
loc = Mid(u, 13, 1)
MSComm1.Output = "AT+CMGR=" & loc & Chr(13)
Text1.Text = Text1.Text & "AT+CMGR=" & loc & Chr(13)
Text1.Text = MSComm1.Input
message = Text1.Text
'message = "@0996.54553,N,07630.23133449,E,@0968.5172,N,07639.4825,E"
message = "@0997.9844,N,07660.2006,E,@0968.5172,N,07639.4825,E"
sms() = Split(message, "@")
mess = sms(1)
sm() = Split(mess, ",")
lat = sm(0)
convert (lat)
lat1 = resultl
t1 = lat1
d1 = sm(1)
lon = sm(2)
convert (lon)
lon1 = result
ln1 = lon1
d2 = sm(3)
Dim stAppName As String
Create KML FILE:
Dim path As String
Shell """C:\Program Files\Google\Google Earth\GoogleEarth.exe"" ""C:\Program Files\Google\Google Earth\ret.kml"""
End Sub
Private Sub Command2_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456FORWARD" & Chr(26)
End Sub
Private Sub Command3_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456RIGHT" & Chr(26)
End Sub
Private Sub Command4_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456LEFT" & Chr(26)
End Sub
Private Sub Command5_Click()
MSComm1.PortOpen = True
End Sub
Private Sub Command6_Click()
MSComm1.PortOpen = False
End Sub
Private Sub Command7_Click()
MSComm1.Output = "AT+CMGS=" & Chr(34) & "+91" & num & Chr(34) & Chr(13) & "123456PULLY" & Chr(26)
End Sub
Function convert(val As String)
temp = val
h() = Split(temp, ".")
t = h(0)
l = t / 100
n = h(1)
k() = Split(l, ".")
g = k(0)
o = k(1)
e = o + n
result = g + "." + e
End Function
Private Sub Timer1_Timer()
If MSComm1.InBufferCount > 0 Then
Text1.Text = MSComm1.Input
End If
End Sub
3 comments:
is this code working?
is this code working?
Yes,It was worked for me.Try this
Post a Comment