|
-
Aug 28th, 2006, 09:24 AM
#1
Thread Starter
New Member
how to isolate GPS data into pieces?
I have the GPS data received as:
$GPRMC,040302.663,A,3939.7,N,10506.6,W,0.27,358.86,200804,,*1A
I want to isolate the GPS sentence into individual piece so I can display it into a textbox in a form with the following:
GPSTime:
Latitude:
Longitude:
Velocity:
Heading:
First thing is I need to detect the incoming text $GPRMC, if the $GPRMC is valid then use the data,
Who can I do that? I try to use the select case but it does not work.
Can anybody help me out?
Here is my code:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
AxMSComm1.PortOpen = True
Button1.Text = "OPENED"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim gpsdata As String
Dim txtFilter As String
gpsdata = AxMSComm1.Input
TextBox1.Text = gpsdata
txtFilter = Mid(gpsdata, 1, 6)
Select Case (txtFilter)
Case "$GPRMC"
TextBox2.Text = Mid(gpsdata, 8, 6) 'GPS Time
TextBox3.Text = Mid(gpsdata, 21, 4) 'Latitude
TextBox4.Text = Mid(gpsdata, 30, 4) 'Longitude
'first, I want to make sure the above 3 boxes
'get the right data.
'More data (other 2 boxes)will be implement later on
'textbox5 - later
'textbox6 - later
End Select
End Sub
End Class
Last edited by cxiong; Aug 28th, 2006 at 09:27 AM.
cxiong
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|