Garmin GPS 16-HVS Руководство по эксплуатации - Страница 10
Просмотреть онлайн или скачать pdf Руководство по эксплуатации для Морская система GPS Garmin GPS 16-HVS. Garmin GPS 16-HVS 30 страниц. Instruction manual
Также для Garmin GPS 16-HVS: Руководство по эксплуатации (30 страниц), Справочное руководство (1 страниц), Технические характеристики (40 страниц), Технические характеристики (37 страниц), Декларация о соответствии (2 страниц)
Garmin 16-HVS GPS Receiver
4.1.4 SerialClose
4.2 Parsing and Data Storage Options
4.2.1 SplitStr
4.2.2 Converting Strings to Floating Point Numbers
' Sample CR1000 program to read GPS NMEA GPGGA string
Public location, bytes
public GPSData as string * 101 ' $GPGGA string about 57 characters
PUBLIC ParseStr(18) as string * 15
' Aliases allow proper labels in output data tables,
' and when viewing public variables
alias ParseStr(1) = GPGGA
alias ParseStr(2) = TIME
alias ParseStr(3) = LAT
alias ParseStr(4) = HEMINS
alias ParseStr(5) = LONGI
alias ParseStr(6) = HEMIEW
alias ParseStr(7) = QUAL
alias ParseStr(8) = NUMSATS
alias ParseStr(9) = HDP
alias ParseStr(10) = ALTDE
6
The SerialClose instruction is used to close the serial port. Once closed, the
SerialOpen command must be used before more data can be read.
The CR1000, CR3000, CR800, and CR850 can store data as a string or as a
number. Every time the datalogger stores a string, the size of the string
determines the number of bytes used. If the string was declared to be 101
bytes long, every time the string is written to memory, 101 bytes are used.
Depending on the application, the entire GPGGA string can be stored to
memory or just specific parts. When storing specific parts, some numbers can
be converted to floating data points.
To parse the GPGGA string, first read the entire string into 1 large string (see
Section 4.1). Next parse the string into a group of smaller strings (see Section
4.2.1). Determine which of the smaller strings to keep and which to convert to
floating point number, then store the data.
Use the SplitStr instruction to parse the GPGGA string into an array of strings.
Declare an array of 18 strings of 15 characters.
Example: ParseStr(18) as string * 15
The SplitStr instruction uses the result string, search string, filter string,
number of splits and split option to parse the search string and store the results
in the result string. The GPGGA string uses the comma character (chr(44))
between each parameter. The comma makes a nice marker to parse on.
Example: SplitStr (ParseStr(1),GPSData ,chr(44),18,5)
Strings can be converted to floats with the simple assignment operator, but
Latitude and Longitude require more precision than the CR1000, CR3000,
CR800, or CR850 will store as a floating point number.