SERIAL INTERFACE SPECIFICATION FOR THE TREE MEASUREMENT LASER INITIAL DRAFT REV. 2.2 5/20/92 INTRODUCTION: This specification describes the interface and data format of the LTI Tree Measurement Laser Revision 2.2. Since the Laser is expected to interface to recording equipment also reading GPS devices, data format from and to the Laser will use the standard data protocol common to may GPS systems. The data format, where applicable, will follow the guidelines of the NMEA 0183 Standard for Interfacing Marine Electronic Navigational Devices (Revision 2.0). The NMEA 0183 standard has provisions for both standard and proprietary data formats. Since none of the standard formats are useful for the data transferred from the Tree Laser, special proprietary formats are used as defined in this document. Rules described in the NMEA standard governing the general message structure; leading and trailing characters, numeric values, delimiting character, checksums, maximum line length, data rate and bit format will be followed exactly. As required in the NMEA 0183 standard, the Tree Laser will not respond to unrecognized header formats. In addition, it will also not respond to malformed messages, or invalid checksums. Though the standard is designed to allow multiple instruments to talk and listen on the same line, the RS-232 electrical interface and the limited ability of the Tree Laser to achieve serial communications and measurements at the same time, would make it impractical to use in a continuously active multiple instrument environment. ELECTRICAL AND CHARACTER FORMAT CHARACTERISTICS: RS-232 +/-12V signal levels and data format are used for the Tree Laser interface. Format parameters are set to the following values: Baud Rate 4800 bps Data bits 8 Parity None Stop bits 1 1 HARDWARE INTERFACE: Serial connection to the Tree Laser is via the second connector located on the battery pack. Two connectors are provided on each battery pack. One for connection to the Tree Laser and the other to the downloading computer or data recorder. Both connectors are wired identically and may be interchanged. Pinout assignments are as follows: Pin 1: Battery Ground Pin 2: Battery +12V Pin 3: Serial In (RX) Pin 4: Serial Out (TX) Pin 5: Serial Ground (Use for serial ground reference only) Pins 1 and 2 are intended for power to the LASER INSTRUMENT ONLY and SHOULD NOT be connected in the downloading cable. NMEA-0183 RECORD STRUCTURE: The following summary is the basic definition of the NMEA-0183 data structure and information on the specific records used by Laser Technology. $PLTIT,TTT,DDD.D,U,,,,.........*CS "$" Indicates the start of record. "PLTIT": The first 5 ASCII character following the $ make up the address identifier of the record. This identifier is used on all records to and from the Tree Laser. Pre-defined approved (non- proprietary) identifiers, as well as, provisions for proprietary identifiers exist in the NMEA standard. None of the pre-defined formats are applicable to interfacing the Tree Laser, so a proprietary identifier has been chosen. "P" indicates a proprietary record. "LTI" is the manufacturers identification field, representing an abbreviation for Laser Technology, Inc., and is used in all Laser Technology products conforming to the NMEA standard. The "T" is a sub-identifier indicating this is a tree measurement laser. The "LTI" manufacturers ID is registered with the NMEA Standards Committee. All data fields are preceded by a ",". "TTT": All Tree Laser output data fields are preceded by a data type identifier such as "HT" for tree height, "DA" for diameter, etc.. See the Data Types and Specific Formats section for a complete list. 2 "DDD.D": Laser Data Field. A base 10 integer or floating point data value. Numbers output from the Laser are formatted according to the following rules: Integer values have leading 0's removed and have no trailing decimal point. The value zero is a single "0" character. Floating point values have 1 or 2 decimal places (depending on the data type). Leading 0's are removed, but fractional values always contain a fixed number of decimals, filled with 0's if necessary. Values 0 to 1 have a single 0 left of the decimal point (such as 0.15). The value for 0 in 2 decimal places would have a similar format (0.00). No exponent fields are produced by the tree laser. Both integer and floating point values are preceded by a "-" for negative numbers. There is no preceding character for positive numbers. "U" When appropriate, data field values will be followed by a unit's designator such as "F" for feet, "D" for degrees, etc. All data fields with inactive or null values will be indicated with no data following the field delimiting comma, such as ",,". An optional checksum if included, is indicated by the "*" character followed by a 2 character hexadecimal checksum. The checksum is calculated by XOR'ing the 8 binary Data bits (not start, or stop bits) of each valid data character in the record sentence, between the "$" and the "*" delimiters. The "$", "*", and checksum value are not included in the checksum calculation. Checksum fields may optionally be left off the messages sent to the Tree Laser, but are always generated on messages sent from the Tree Laser. Valid messages to or from the Tree Laser must always contain carriage return and a line feed on the end. LASER RESPONSE AND TIMEOUTS: The Tree Laser is programmed to follow 1 of 2 rules when it receives invalid or out of range query commands. First, the Laser will not respond (no output) to a query message under the following conditions: Incorrect query record structures, including invalid start of record, record count, address identifier, query commands, checksum or terminator characters. Second, when requesting unit survey data, if the number field for a record request is out of range, or not in a positive integer format, a response message will be returned, but the data fields will contain all null values. 3 Should the user wish to incorporate a timeout in the querying program to allow for communication errors, the following information should be useful: The Laser software should be able to format and start transmitting the longest message in about 30 MS. A timeout of .1-.2 second should be more than adequate. The Tree Laser enables the serial port, and is available for query, anytime the program is waiting for key input. Queries for all data types will respond at this time. Tree Heights, tree diameters, conic projections and basic survey measurements will return null data if the Laser program is not in the appropriate menu with a recent valid measurement taken. Unit survey array data is available anytime the serial port is active from any menu. Due to limited resources of the Laser's micro processor, the serial port is disabled while preforming any sensor readings and the associated calculations. It is also disabled whenever the number editing routine is in use (under bar cursor showing on the display). Conversely, all key input and sensor measurement activities are suspended during data transfers on the serial port. Data transfer activity is indicated when the "DOWNLOADING" message appears on the LCD display. LASER ID, DATA QUERY AND USER PROMPTED OUTPUT: The LTI Tree Laser takes and downloads 5 types of measurements, tree heights, tree diameters, conic height projections, basic survey measurements, and unit multiple point survey measurements. Coordinate location measurements are also available in the Tree Laser, but are not available for download. Except for Unit Survey data, each of the download measurements may be either queried from the downloading host or downloaded on command by the instrument user. User download occurs when the ENTER key is pressed in any of the final result measurement menus. Tree heights, diameters, conic projections and basic survey measurements are read and stored in a temporary RAM variable at the time the measurement is taken. Each of these items must be downloaded immediately after a valid measurement is taken. Invoking another reading or leaving the current procedure menu will change to delete any previous values. Multiple point survey measurements are stored in non- volatile memory arrays. This data is available only by query commands 1 record at a time from the serial port and is available any time the serial port is active. In addition to the measurement data, an identification and revision record may be queried from the laser at any time. 4 Survey measurements may be taken as individual sensor readings or combined readings and can also be downloaded individually or combined. SPECIFIC FORMATS: The following are explanations and examples of each of the data record types available from the Tree Measurement Laser. Note all query messages contain the, RQ, request data field. IDENTIFICATION AND REVISION ID: The revision number field returned, applies to the current hardware and software instrument version. The revision message is available by query only and available anytime the serial port is active. Query Message: $PLTIT,RQ,ID*5B Response Message: $PLTIT,ID,2.2*76 TREE HEIGHTS: Valid tree heights are available for download only when the height result menu is showing on the Tree Laser display. Height data messages are output on request from a query message or when the ENTER key is pressed while in the height result menu. Heights are calculated as a trigonometric solution from horizontal distance, base angle and top angle measurements. The calculated height is assumed to be on a vertical line located at the end point of the horizontal distance measurement. Query Message: $PLTIT,RQ,HT*4A Response Messages: Valid Data Available: $PLTIT,HT,63.4,F*3C Bad Reading or Null data: $PLTIT,HT,,*65 The height data field decimal places may be 0 to 2 depending on user programmed configuration. Maximum values are limited only by sensor capability. The character output field could be as much as 5 places to the left of the decimal on non-tree readings. Also, should the operator accidently reverse measurement procedures and enter the base angle and top angle in the wrong menu, a negative height value will be produced. The units field will be either "F" for feet or "M" for meters. This is also set by a user programmed configuration. 5 TREE DIAMETERS: The diameter message consists of two measurements, first is the height of the diameter measurement and second is the diameter at that height. Valid tree diameters are available for download only when the height/diameter result menu is showing on the Tree Laser display. Diameter data messages are output on request from a query message or when the ENTER key is pressed while in the height/diameter result menu. Height of the diameter measurement is calculated with the same trigonometric solution from horizontal distance, base angle and top angle measurements, as used in the tree height measurements. The diameter value is calculated with a trigonometric solution using direct distance to the point of the diameter and the angular width determined from the telescope reticle reading. The direct distance to the point of the diameter is determined as a trigonometric solution from the horizontal distance and the vertical angle to the diameter point. The diameter calculation also has adjustment factors to project the diameter to the center of the tree assuming the horizontal distance is taken to the face of the tree. (Thus the diameter measurement will not generate accurate width measurements on a flat surface.) Query Message: $PLTIT,RQ,DA*53 Response Messages: Valid Data available: $PLTIT,DA,6.5,F,37.2,I*46 Bad Reading or Null Data: $PLTIT,DA,,,,*7C The data fields in order from left to right are: Height from the base of the tree and Units. Diameter at that height and Units. The data field decimal places may be 0 to 2 depending on user programmed configuration. Maximum values are only limited by the maximum range of the sensors. The units field for height is "F" for feet or "M" for meters and the units for diameter is "I" for inches or "C" for centimeters. TREE CONIC PROJECTIONS: A Conic Projection measurement consists of the user inputting a desired projection diameter, then measuring two height/diameter pairs in the area of the projected diameter in the same uniform area of taper. The Tree Laser then projects the taper generated by the height/diameter readings and calculates the height to the user input diameter. The laser also calculates and displays the number of 16.5 FT. standard U.S. log lengths to the calculated height. 6 The Conic Projection message consists of the user input projection diameter, the calculated height and the calculated number of log lengths. Each height/diameter measurement consists of the same readings and calculations as described in the Tree Diameter section. Valid Conic Projection data is available for download only when the conic height/logs result menu is showing a valid value on the Tree Laser display. Conic Projection data messages are output on request from a query message or when the ENTER key is pressed while in the conic height/logs result menu. Query Message: $PLTIT,RQ,CH*5D Response Messages: Valid Data Available: $PLTIT,CH,12.0,I,24.5,F,1*60 Bad Reading or Null Data: $PLTIT,CH,,,,,*5E The data fields in order from left to right are: User entered projection diameter and Units. Calculated height to the projected diameter and Units. Number of 16.5 FT. standard U.S. log lengths. The diameter and height field decimal places may be 0 to 2 depending on user programmed configuration. The log height field is always in integer format with no decimals. Maximum values are only limited by the maximum range of the sensors. The units field for height is "F" for feet or "M" for meters and the units for diameter is "I" for inches or "C" for centimeters. BASIC SURVEY MEASUREMENTS: Simple and combined forms of the basic survey data are available. Combined forms are Horizontal Distance and Horizontal Vector. Horizontal Distance is the raw range or slope distance corrected to the horizontal. Horizontal Vector is a combined horizontal distance and azimuth. Simple forms are the uncorrected slope distance, vertical inclination (angle from the horizontal) and azimuth (clockwise magnetic angle from North corrected for declination). In addition, the currently programmed magnetic declination offset can be read. Valid basic measurements are available only when one of the basic survey menus are showing on the Tree Laser display. By selecting appropriate menus, any combination of single or grouped sensors amy be triggered for a measurement and the results may be viewed singly or grouped. Any grouped or single combination may also be downloaded in response to a query message. Only the message associated with a specific menu may be downloaded using the ENTER key method. 7 HORIZONTAL VECTOR: The horizontal Vector data message contains a combined horizonal distance value and the individual sensor measurements (azimuth, inclination, and slope distance). The inclination and slope distance (range) are made available both individually and combined as horizontal distance for maximum convenience and completeness for the receiving program. Valid Horizontal Vector measurements are available on query from any of the basic survey menus. Only the Horizontal Vector message will be sent when the ENTER key is used in the Horizontal Vector menu. Depending on the menus selected for measurements and the sensors that complete a valid measurement, any of the 3 data fields may contain valid or null values. Query Message: $PLTIT,RQ,HV*48 Response Messages: Valid Data Available: $PLTIT,HV,34.2,F,176.8,D,6.52,D,34.5,F*59 Partial Null Data: $PLTIT,HV,34.2,F,,,6.52,D,34.5,F*38 $PLTIT,HV,,,176.B,D,6.52,D,,*5E All Null Data: $PLTIT,HV,,,,,,,,*67 The data fields in order from left to right are: Horizontal Distance and Units Azimuth and Units Inclination and Units Slope Distance (Simple Range) and Units HORIZONTAL DISTANCE: The Horizontal Distance data message contains a combined horizontal distance value and the individual sensor measurements (inclination, and slope distance). The inclination and slope distance (range) are made available both individually and combined as horizontal distance for maximum convenience and completeness for the receiving program. Valid Horizontal Distance measurements are available on query from any of the basic survey menus. Only the Horizontal Distance message will be sent when the ENTER key is used in the Horizontal Distance menu. Depending on the menus selected for measurements and the sensors that complete a valid measurement, either of the 2 data fields may contain valid or null values. 8 Query Message: $PLTIT,RQ,HD*5A Response Messages: Valid Data Available: $PLTIT,HD,40.1,F,-5.19,D,40.2,F*0C Partial Null Data: $PLTIT,HD,,,,,40.2,F*2B Bad Reading of Null Data: $PLTIT,HD,,,,,,*75 The data fields in order from left to right are: Horizontal Distance and Units Inclination and Units Slope Distance (Simple Range) and Units. AZIMUTH: The azimuth message contains only the magnetic compass heading value. All azimuth values are the sum of the magnetic compass reading and the current magnetic declination. A valid Azimuth measurement is available on query from any of the basic survey menus. Only the Azimuth message will be sent when the ENTER key is used in the Azimuth menu: Query Message: $PLTIT,RQ,AZ*4D Response Messages: Valid Data Available: $PLTIT,AZ,182.5,D*06 Bad Reading or Null Data: $PLTIT,AZ,,*62 VERTICAL INCLINATION: The Inclination message contains only the vertical tilt sensor reading value. A valid Inclination measurement is available on query from any of the basic survey menus. Only the Inclination message will be sent when the ENTER key is used in the Inclination or Percent Slope menus. Query Message: $PLTIT,RQ,VI*49 Response Messages: Valid Data Available: $PLTIT,VI,-13.52,D*24 Bad Reading or Null Data: $PLTIT,VI,,*66 9 SLOPE DISTANCE: The Slope Distance message contains only the laser range reading value. A valid Slope Distance measurement is available on query from any of the basic survey menus. Only the Slope Distance message will be sent when the ENTER key is used in the Slope Distance menu. Query Message: $PLTIT,RQ,SD*41 Response Messages: Valid Data Available: $PLTIT,SD,643.7,F*00 Bad Reading or Null Data: $PLTIT,SD,,*6E MAGNETIC DECLINATION: The Magnetic Declination message returns the current declination set by the user. The declination value is added into all azimuth values generated in the Basic Survey, Coordinates and Unit Survey operations. The Magnetic Declination message is downloaded only on query and is available any time the serial port is active. Query Message: $PLTIT,RQ,MD*5F Response Message: $PLTIT,MD,11.24,D*1C BASIC SURVEY UNITS: Basic Survey Distances and Vertical Inclination are user programmable to 0 to 2 decimal places and Azimuth programmable to 0 to 1 decimal places. Distances may be up to the limit of the laser (5 places to the left of the decimal point). Distance units are programmable to feet "F" or meters "M". Inclination, Azimuth units are programmable to degrees "D" or grads "G". Magnetic Declination units are only entered in and available for download in degrees "D". MULTIPLE POINT PLOT UNIT SURVEY MEASUREMENTS: Multiple point surveys are arrays of basic sensor measurements with connective descriptors to join the measurements in useful survey patterns. Each point consists of 1 azimuth, 1 inclination and 1 slope distance reading with a FROM and a TO integer descriptor which indicate which survey points the measurement is taken from and shot to. 10 The arrays are stored in non-volatile memory and are available for download only by query commands, 1 record at a time. The survey data is available when the Tree Laser is set to any menu, anytime the serial port is active. There are 20 separate surveys with a storage capability of 1350 combined points for the 20 surveys. There is no fixed divided limit for any individual survey. The decision to represent data points as basic sensor measurements with FROM/TO descriptors was chosen to allow more post processing options for the user, rather than representing them in a coordinate system. By using the basic sensor measurements and shooting additional cross checking shots, the post processing software can have the flexibility of performing error checks, averaging values and correcting for magnetic anomalies affecting the magnetic compass readings for increased accuracy. In the User entry mode, there are no restrictions on the numbering of the FROM/TO descriptors or the order of entry of the data points. This provides a high degree of flexibility in survey layouts, maximizing setups, and post processing mapping, corrections and tests. In addition to the general purpose entry of data points the Tree Laser is equipped with three additional, special function keys to automatically number the survey point FROM/TO fields for the perimeter surveys normally used to measure tree plots. These keys are labeled INLINE, SIDE and CLOSE. The INLINE key generates points in a single unbroken line. The SIDE key optionally generates side shots from the main line survey and the CLOSE key optionally closes the main line survey. The INLINE key may be configured to generate Foresight only shots, Backsight only shots, or Foresight/Backsight pair shots. Shots generated with the special function keys may be interspersed with user generated shots. As the primary rule, the special function keys use the next higher unused point number to generate the next shot. Though the point numbers generated by the INLINE key may not be contiguous, they are guaranteed to be one single line, optionally closed at the end with the CLOSE key. (Refer to the main users manual for typical point generation examples). When downloading, the data message for each point, each one contains a type field indicating how the point was generated. Foresight inline key shots will have the type 'FS', backsight inline key shots the type 'BS', side key shots the type 'SD', and user generated shots the type 'UR'. The tags generated by the special function keys can be used by the downloading software to simplify the point mapping process and should minimize the effort to configure existing perimeter point processing software to this new point numbering system. Each of the 20 surveys also contain two items to aid in identifying the survey and it's start location. Each survey has a 3 digit identification number called a Unit Number that is downloaded as part of the survey summary information. Each survey also has an optional reference entry to mark the location of the start of the survey. 11 The start point may be identified with a unit number and point in that unit to reference it to a point on another survey, or it may be identified with and X, Y, Z coordinate reference. Unit Survey data is accessed by first requesting a summary record for each survey, then requesting the survey data on shot at a time. Each data message may contain one, two or three valid sensor measurements. UNIT SURVEY SUMMARY RECORDS: The Unit Summary message returns a Unit Number and the number of data points for each survey. One summary request is made for each of the 20 survey arrays. The Unit Summary message is downloaded only on query and is available any time the serial port is active. The Unit Number and number of data points is then used to generate the Survey Data request messages. Sample Query Message to obtain the download information for Survey #3: $PLTIT,RQ,US,3*4F Response Message: $PLTIT,US,3,43,56*64 The data fields returned are, in order from left to right: The queried survey number. The Unit Number identifier. The number of survey points stored for this survey. Sample Exception Query Messages: Response message if no data is stored in the requested survey: (Unit Number and number of points fields are null) $PLTIT,US,5,,*66 Response message if the queried survey number is not in the range 1-20: (All 3 data fields are null) $PLTIT,US,,,*53 UNIT SURVEY DATA QUERY MESSAGES: Unit Survey records are downloaded one record at a time, referenced by Unit Number and record index number. Note the record index number corresponds to the order in which the measurements were taken, but does not correspond to the numbering in the FROM/TO fields. 12 Sample Query Message to obtain the survey data at storage location #1 in the survey with unit descriptor #12: $PLTIT,RQ,UD,12,1*75 Unit Survey Data Response Messages: $PLTIT,UD,12,1,FS,1,2,187.2,D,-5.87,D,34.9,F*2D The data fields returned are, in order from left to right: The queried Unit Number. The queried Record Number. How the point was generated identifier: FS, BS, SD, or UR The measurement location FROM identifier. The measurement location TO identifier. Azimuth and Units. Inclination and Units. Slope Distance and Units. Examples of partial or completely null records: Data message with a null azimuth reading: $PLTIT,UD,12,1,FS,1,2,,,-5.87,D,34.9,F*4B Data message with a null azimuth and inclination reading: $PLTIT,UD,12,1,FS,1,2,,,,,34.9,F*36 Data message response to requesting a point number outside the range of existing points: $PLTIT,UD,,,,,,,,,,,*44 Data message response to requesting a non-existent Unit Number: $PLTIT,UD,,,,,,,,,,,*44 Unit Survey Distances and Vertical Inclination are user programmable to 0 to 2 decimal place and Azimuth programmable to 0 or 1 decimal places. Distances may be up to the limit of the laser (5 places to the left of the decimal point). Distance units are programmable to feet "F" or meters "M". Inclination and Azimuth units are programmable to degrees "D" or Grads "G". UNIT SURVEY REFERENCE START POINT: For each survey containing 1 or more survey points, a Reference Start Point message may be queried. The response message will contain either a point in a unit type reference or coordinate type reference. Sample Query Message to obtain the point type reference for survey #2: (Assuming the user entered a point type reference for survey #2) $PLTIT,RQ,UR,2*4F Response Message: $PLTIT,UR,2,PT,110,U,3,P,,*4E 13 The data fields returned are, in order from left to right: The queried survey number. The reference type identifier for point 'PT'. The reference to unit number and unit identifier 'U'. The reference to point in that unit and point identifier 'P'. The last two fields are always null. Sample Query Message to obtain the coordinate type reference for survey #3: (Assuming the user entered a coordinate type reference for survey #3) $PLTIT,RQ,UR,3*4E Response Message: $PLTIT,UR,3,CD,1000.00,F,2000.00,F,-20.00,F*0E The data fields returned are, in order from left to right: The queried survey number. The reference type identifier for coordinates 'CD'. The X axis reference coordinate and units. The Y axis reference coordinate and units. The Z axis reference coordinate and units. The units field will be in feet 'F' if the survey ranges are taken in feet or in meters 'M' if the survey ranges are taken meters. Data message response to requesting a reference for a survey with no data points stored: $PLTIT,UR,4,,,,,,,*4A Response message if the queried reference is for a survey number not in the range 1-20: $PLTIT,UR,,,,,,,,*7E All references of NMEA information were obtained from: NMEA National Marine Electronics Association NMEA 0183 Standard for Interfacing Marine Electronic Navigational Devices Version 2.0 January 1992 February 1992 Printing Copyright NMEA 1988 14 SERIAL