Parse GPS data from your PACs 232 port

Hi All,

The attached PAC Control Basic 8.0 chart (can be imported into any 8.0 basic or better strategy) to parse GPS data on a RS-232 port. It shows how to make use of the EOM (end of message) character when receiving strings using a communication handle, and a couple of ways to parse data in a string table.

When there’s a LOT of data to be received/parsed, I like to write it to a temporary file then search through the file, as show in this example.

Also see this thread for more on RS-232 comm handle usage.

Happy coding!

p.s. This data coming in looks something like this:


This website was helpful for decoding: (3.5 KB)

Somewhat related to this post on “true” – there are several ways of determining if a string starts with “$GPGLL” and setting a Found flag true if so. A couple examples:

    if (0 == FindSubstringInString("$GPGLL", 0, sTemp) ) then // we found the GPG Lat Lon info


    nFound = ( (sTemp[0] == '$') and (sTemp[1] == 'G') and (sTemp[2] == 'P') and (sTemp[3] == 'G') and // they should all start w/$GPG
         (sTemp[4] == 'L') and (sTemp[5] == 'L') );

I have your strategey that grabs the IP address through the modem so I can insert it in an email. Is there a way to do the same thing with GPS data? (the modem has GPS)

I’m not entirely sure what you’re asking for here, but many modems support communication via serial, e.g. an AT command. If your modem has an AT command to give you that GPS data, then it’s probably do-able. Sometimes you get get data from a modem via UDP, too. But modems vary widely! What does the modem’s manual say?

Update, found out that the modem uses TAIP data, which is Trimbals own version of NMEA data.

You can use the same chart, but change the strings that are searched for, its all just strings…

James Davis helped me. We set up the modem to pass GPS data to a COM handle, using an example chart.