Windmill Software Ltd |
![]() May 2005 |
Interfacing
|
Although each electronic measuring instrument does a necessary job on its own, it is often far more useful when its information is integrated with that from other pieces of equipment. Depth data from sonar and position data from a GPS receiver combined to plot a contour map for example. The NMEA interfacing standard ensures that conforming instruments all speak the same language. This language can be understood by PC programs like the free Windmill software, and results from many different instruments can be logged to one time-stamped file. The standard was developed by the US-based National Marine Electronics Association in the 1980s. The NMEA 0183 standard uses ASCII messages which can be sent over RS232 serial links. In 2000 a new standard was released - NMEA 2000. This uses CAN (Controller Area Networks). This article concentrates on NMEA 0183. NMEA 0183 Sentence StructureThe standard specifies communication in coded sentences in ASCII (text) format. Each sentence begins with the dollar character, $, and ends with a carriage return and a line feed. Between the beginning and the end are identifier and data fields, separated by commas. The first two characters following the $ comprise the "talker" identifier, describing the type of instrument sending the data. For example $GP for GPS receiver or $ZA for atomic clock. Other talker identifiers include: AP Magnetic Autopilot CV Communications - Radio-Telephone (VHF) DF Direction Finder EP Emergency Position Indicating Beacon (EPIRB) ER Engine Room Monitoring Systems GP Global Positioning System (GPS) HC Magnetic Compass HE North Seeking Gyro IN Integrated Navigation LC Loran C OM Omega receiver P Proprietary Code RA RADAR SD Depth Sounder SN Electronic Positioning System, other/general SS Sounder, Scanning TI Turn Rate Indicator VD Velocity Sensor, Doppler, other/general DM Velocity Sensor, Speed Log, Water, Magnetic VW Velocity Sensor, Speed Log, Water, Mechanical WI Weather Instruments YX Transducer ZA Timekeeper Atomic Clock ZQ Timekeeper Quartz Following the talker ID is a three letter code identifying the type of sentence. For example: DBT Depth below transducer GGA Global positioning system fix data GLL Geographic position, Latitude, Longitude HDT Heading true MTW Water temperature MWD Wind direction MWV Wind speed and angle RMC Recommended minimum specific GPS/transit data RSD RADAR system data VBW Water referenced and ground referenced speed XDR Transducer measurements ZDA Time and date Next are the comma separated data values. Here is an example of a complete NMEA sentence. $GPGLL,5330.12,N,00215.31,W,134531,A*2D<CR><LF> Following the $ marking the beginning of the code comes the 2-letter code identifying the instrument sending the data. In this case it is GP for GPS receiver. The 3-letter sentence identifier, GLL, tells us that the data that follows will give geographic position, latitude and longitude. The data shown is:
5330.12 - Latitude 53 degrees and 30.12 minutes,
ie 53 degrees, 30 minutes and 7 seconds.
N - North (or S for South).
00215.31 - Longitude 2 degrees and 15.31 minutes,
ie 2 degrees, 15 minutes and 19 seconds.
W - West (or E for East).
124531 - UTC Time of 13:45 and 31 seconds (hhmmss).
UTC stands for Co-ordinated Universal Time.
This time scale is kept by time laboratories
around the world and is determined using
precise atomic clocks. It is equivalent
to Greenwich Mean Time (GMT).
A - Data valid (or V for data invalid).
*77 - The checksum. This is an optional calculation
resulting in 2 hexadecimal digits to check
that the sentence has been properly transmitted.
<CR><LF> - Carriage return and line feed to mark the end
of the sentence. These are non-printing
characters that might not be seen but will be
transmitted as ASCII characters 013 and 010.
The maximum sentence length is 80 characters. If data is unavailable two commas with nothing in between are sent. The standard allows a manufacturer to define its own proprietary sentences. These allow more functionality but are unique to each manufacturer. These type of sentences start with "$P". This is followed by a 3-letter manufacturer ID and a 1-letter sentence identifier. Connecting to a PCNMEA 0183 instruments have serial ports. With a suitable cable they can generally by plugged into the PC's RS232 serial connector. Software like Windmill can then collect and interpret the data being sent from the instrument to the PC. Some manufacturers may use non-standard cables and plugs. It is often easiest, therefore, to buy the cable from your instrument supplier but you can make or modify your own. The NMEA signal or output line needs to be connected to the RS232 receiver or input line (line 2 on a 9-pin plug). The NMEA ground or earth needs to be connected to the RS232 ground or earth (5 on a 9-pin plug). Issue 42 of Monitor gave details on RS232 connections. The NMEA 0183 Interface Standard specifies the
communication settings as You will need to tell the data acquisition software about the communication settings your instrument is using. Software to Capture NMEA dataAfter connecting your NMEA devices to the computer you need some software to capture the data and save it in a file. The free Windmill 4.3 software does this - as does the newer and easier to configure Windmill 6 with COMIML software - http://www.windmillsoft.com/comiml.html. Windmill also lets you chart data and export it to other programs like mapping packages, spreadsheets and databases. When using Windmill you have to specify how to parse the data sentence, storing each type of data in a channel. For example, with our sentence $GPGLL,5330.25,N,00215.31,W,134531,A*2D
to obtain a latitude reading you might Further ReadingFor more on the National Marine Electronics
Association, or to purchase a copy of the standard,
see
http://www.nmea.org/ |
Home | Windmill Programs | Monitor | On-Line Shop | Free Literature and Software Demos | Contents | Search
| Copyright Windmill Software Ltd 2005 PO Box 58, North District Office, Manchester, M8 8QR, UK. E-mail: sales@windmill.co.uk, Tel: +44 161 833 2782 http://www.windmill.co.uk/nmea.html Designed by Studholme.net |