Communication Specification for GlobalSat DG-100

Model: DG-100
Product: GPS data logger

Revision History
Version Change History Issue Date Remark
0.1 Initiation Jan 30, 2007 Preliminary
0.1(unofficial) Corrections March 7, 2008 Unofficial

n.b. This version of the spec is unofficial - I have added PK's notes and added the 'mouse mode' commands.


The Format of communication between PC software and DG 100

  1. General Format & Rules

    1. 1.1 For Sending Format

      The general format of communication sent to DG 100 is:

      Start Sequence Payload Length Payload Message Checksum End Sequence
      0xA0,0xA2 Two-bytes Up to 1023 Two-bytes 0xB0,0xB3
    2. 1.2 For Returning Format

      The general format of communication received from DG 100 is:

      Start Sequence Payload Length Payload Message Checksum End Sequence
      0xA0,0xA2 Two-bytes Up to 1023 Two-bytes 0xB0,0xB3
      Note:
      • The spec. states that the end sequence for the return is: 0x0D,0x00, however it is in fact 0xB0, 0xB3
      • All information from/to DG100 is Big-Endian.
      • The information exchanged between PC software and DG 100 is located in the PAYLOAD field.
      • For RETURNED COMMAND, the length of PAYLOAD is ignored.
    3. 1.3 How to calculate checksum

      Assume PAYLOAD is an array that is transmitted, and PAYLOAD_LEN is the length of this array:

      checksum = PAYLOAD [0]; For ( i =1; i < PAYLOAD_LEN; i++) { checksum = checksum + PAYLOAD [i]; } checksum = checksum & (1<<15 - 1);
      Note:
      • The last line of the checksum funtcion masks bit 15 (i.e. the most significant bit in the checksum.) This means that the checksum will never be larger than 32767 (decmial.)

    4. 1.4 Payload Format

      The exchange data format used in DG is:

      Command ID Parameter
      One-byte n-bytes value
  2. Communication Interface

    1. 2.1 Get Configuration

      Send Command
      Command ID Parameter
      0xB7 None
      Return Value
      Command ID Parameter
      0xB7 44-bytes value
      Parameter description:
      Information TypeByte 0
      Speed Threshold FlagByte 1
      Speed ThresholdByte 2-byte 5
      Distance Threshold flagByte 6
      Distance ThresholdByte 7-byte 10
      Time Interval 1Byte 11-byte 14
      Time Interval 2Byte 15-byte 18
      Time Interval 3Byte 19-byte 22
      Not usedByte 23
      Not usedByte 24
      Interval by time1/distance1 flagByte 25
      Interval by time2/distance2 flagByte 26
      Interval by time3/distance3 flagByte 27
      Interval by distance1Byte 28-byte 31
      Interval by distance2Byte 32-byte 35
      Interval by distance3Byte 36-byte 39
      Not usedByte 40
      Memory usageByte 41
      Not usedByte 42
      Not usedByte 43
      Notes:
      • The unit of time is seconds.
      • The unit of distance is meter.
      • PK NOTE : both are * 1000;
      • The value of flag: 0 is DISABLE, 1 is ENABLE.
      • PK NOTE : 0 is time interval 1 is Distance interval
      • Information type: 0: position only, 1: position, speed and date/time, 2: position, speed, date/time and altitude.
      • PK NOTE : Memory usage is in fact percentage of free memory
      PK SAMPLE:

      A0A2 0035 B7 02 00 00000000 00 00000000 00007530 00002710 000003E8 00 00 00 00 00 00000000 00000000 00000000 00 5D 01 01 03CD B0B3

    2. 2.2 Set Configuration

      Send Command
      Command ID Parameter
      0xB8 41-bytes value
      Return Value
      Command ID Parameter
      0xB7 or 0xB8 4-bytes value
      Send Parameter description:
      Information TypeByte 0
      Speed Threshold FlagByte 1
      Speed ThresholdByte 2 - byte 5
      Distance Threshold FlagByte 6
      Distance ThresholdByte 7 - byte 10
      Time Interval 1Byte 11 - byte 14
      Time Interval 2Byte 15 - byte 18
      Time Interval 1Byte 19 - byte 22
      Not usedByte 23
      Not usedByte 24
      Interval by time1/distance1 flagByte 25
      Interval by time2/distance2 flagByte 26
      Interval by time3/distance3 flagByte 27
      Interval by distance1Byte 28 - byte 31
      Interval by distance2Byte 32 - byte 35
      Interval by distance3Byte 36 - byte 35
      Not used, set to 0x01Byte 40
      Return Parameter description:
      ResultByte 0 - byte 3
      Notes:
      • PK NOTE : Byte40 should be set to 0, not 1
      • PK NOTE : return commandID was always B7 for me
      • If it is OK, result = 1.
    3. 2.3 Get Track file header

      Send Command
      Command ID Parameter
      0xBB 2-bytes value
      Return Value
      Command ID Parameter
      0xBB (12*N+4)-bytes value
      Send Parameter description:
      The index of the first train file in this iteration
      Byte 0 - byte 1
      Return Parameter description:
      The number of track file headers returned (N)Byte 0 - byte 1
      The index of the next track can be gotByte 2 - byte 3
      The track file headerByte 4 - byte(12*N+3)
      Notes:
      • N is the number of track file headers
      • Continue call the function until N = 0.
      • The index of the first track file is the index of the next track file returned in last iteration.
      • The index of the first track file is 0 in the first iteration.
      PK SAMPLE :

      BB 0004 00040002EBC4000384070000 0000000162500003AB170000 0001000167E60003AB170000 00020001AFC70003AB170000 0003EBE70D00

    4. 2.4 Get a track file

      Send Command
      Command ID Parameter
      0xB5 2-bytes value
      Return Value
      Command ID Parameter
      0xB5 1024-bytes value
      Send Parameter description:
      The index of the track file
      Byte 0 - byte 1
      Return Parameter description:
      Track file
      Byte 0 - byte 1023
      Notes:

      The track file is return in two sessions, so the two sessions should be combined together to parse data.

      The End sequence for this command is 6-bytes values.

      Parse track records in a track file:

      1. Get the parameter(1023-bytes value) from two sessions
      2. Strip the GPS information from the parameter(1024-bytes value, byte0-byte1023)
      3. Combine two 1024-bytes value then parse GPS information:
      4. The format of a track file will like as:
      Track record 1Byte 0 - byte31
      Track record 2Byte 32 - byte M
      Track record 3Byte M - byte 2047
      ......
      Track record n

      The format of the first track record must be FORMAT C (32 bytes). The format of other track records in this track file is decided by the field "STYLE" of the first track record. There are three formats for storing track records:

      1. a. Position only(8 bytes):

        LatitudeByte 0 - byte 3
        LongitudeByte 4 - byte 7
      2. b. Position, date/time and speed(20 bytes):

        LatitudeByte 0 - byte 3
        LongitudeByte 4 - byte 7
        UTimeByte 8 - byte 11
        UDateByte 12 - byte 15
        SpeedByte 16 - byte 19
      3. c. Position, date/time, speed and altitude(32 bytes):

        LatitudeByte 0 - byte 3
        LongitudeByte 4 - byte 7
        UTimeByte 8 - byte 11
        UDateByte 12 - byte 15
        SpeedByte 16 - byte 19
        AltitudeByte 20 - byte 23
        Not UsedByte 24 - byte 27
        StyleByte 28 - byte 31

      The format of all fields are described as following, and the type of all fields are number.

      • Latitude : ddmmmmm, N/S indicator: N: if this field > 0, S: if this field < 0
      • Longitude: dddmmmmm, E/W indicator: E: if this field > 0, W: if this field > 0
      • UTime: hhmmss
      • UDate: ddmmyy
      • Speed: (km/hour) * 100
      • Altitude: (meter)*10000
      • Style: 0: Position only, 1: Position, date/time and speed, 2: Position, date/time, speed and altitude
      Example:

      How the get the track record?

      The raw data (HEX format) is like this: it is FORMAT C 0026239B00B95F380001B2070001D97600000000000000000000000100000002

      So parsing:(0026239B)(00B95F38)(0001B1A1)(0001D912)(00000064)(00006400)(00000001)(00000002)

      fieldhexdecimalhuman
      Latitude0x0026239B249948324°99.483
      Longitude0x00B95F3812148536121°48.536
      UTime0x0001B1A111100911:10:09(hour:minute:second)
      UDate0x0001D9121211062006/11/12
      Speed0x000000641001 (km/hour)
      Altitude0x00006400256002.56 meters
      Style0x000000022Format C
    5. 2.5 Delete All track files

      Send Command
      Command ID Parameter
      0xBA 0xFF,0xFF
      Return Value
      Command ID Parameter
      0xBA 4-bytes value
      Return Parameter
      Result
      Byte 0 - byte 3
      Notes:

      If Result = 1, it is OK.

    6. 2.6 Get the ID of DG

      Send Command
      Command ID Parameter
      0xBF None
      Return Value
      Command ID Parameter
      0xBF 8-bytes value
      Return Parameter
      ID of DG100
      Byte 0 - byte7
    7. 2.7 Set the ID of DG

      Send Command
      Command ID Parameter
      0xC0 8-bytes value
      Return Value
      Command ID Parameter
      0xC0 4-bytes value
      Return Parameter
      Result
      Byte 0 - byte 3
      Notes:
      1. One byte represents a digit(0-9), so there 8 bytes for 8 digits.
      2. If the result = 1, then the save action is OK
    8. 2.8 Putting the DG-100 into 'mouse mode'

      Send Command
      Command ID Parameter
      0xBC 2 byte value
      Return Value
      Command ID Parameter
      0xBC 2-bytes value
      Send Parameter description
      Toggle
      Byte 0 - byte 1
      Return Parameter
      Result
      Byte 0 - byte 1
      Notes:
      1. Mouse mode is when the device becomes a basic GPS receiver. It will start streaming live NMEA data to the PC.
      2. To start mouse mode pass 0x01 as the parameter. To exit mouse mode pass 0x00
      3. The device will return 0x0D for both cases.