Results 1 to 8 of 8

Thread: how to isolate GPS data into pieces?

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    Atlanta, GA
    Posts
    13

    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:
    1. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    2.         AxMSComm1.PortOpen = True
    3.         Button1.Text = "OPENED"
    4.        
    5.     End Sub
    6.  
    7.    
    8.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    9.         Dim gpsdata As String
    10.         Dim txtFilter As String
    11.         gpsdata = AxMSComm1.Input
    12.         TextBox1.Text = gpsdata
    13.         txtFilter = Mid(gpsdata, 1, 6)
    14.         Select Case (txtFilter)
    15.             Case "$GPRMC"
    16.                 TextBox2.Text = Mid(gpsdata, 8, 6)  'GPS Time
    17.                 TextBox3.Text = Mid(gpsdata, 21, 4) 'Latitude
    18.                 TextBox4.Text = Mid(gpsdata, 30, 4) 'Longitude
    19.                 'first, I want to make sure the above 3 boxes
    20.                 'get the right data.
    21.  
    22.                 'More data (other 2 boxes)will be implement later on
    23.                 'textbox5 - later
    24.                 'textbox6 - later
    25.  
    26.         End Select
    27.     End Sub
    28. 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
  •  



Click Here to Expand Forum to Full Width