Loading ...
Sorry, an error occurred while loading the content.

Re: Trying to understand the decoding of the aivdm message bytes

Expand Messages
  • Thormod (Tom) Nordahl
    ... decode AIS: Thanks Peppe. Not only did you give me the answer, but you did the job as well. Tom
    Message 1 of 16 , Aug 1, 2008
    • 0 Attachment
      --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@...> wrote:
      >
      > To answer to your question I add the following routine I'm using to
      decode AIS:

      Thanks Peppe.
      Not only did you give me the answer, but you did the job as well.

      Tom
    • lmukis
      To decode the `data section of an AIVDM sentence – Convert the 8 bit ASCII `data to the 6 bit ASCII used to encode the AIS sentence. Do this by stepping
      Message 2 of 16 , Aug 26, 2008
      • 0 Attachment
        To decode the `data' section of an AIVDM sentence –

        Convert the 8 bit ASCII `data' to the 6 bit ASCII used to encode the
        AIS sentence. Do this by stepping through each character in turn and
        subtracting 48, if the result is greater than 40, subtract another 8.

        For Example –

        !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D

        8bit 6bit
        ------------------------
        0 1 0x31 0x01 000001
        1 4 0x34 0x04 000100
        2 e 0x65 0x2d 101101
        3 G 0x47 0x17 010111
        4 ; 0x3b 0x0b 001011
        5 o 0x6f 0x37 110111
        6 @ 0x40 0x10 010000
        7 0 0x30 0x00 000000
        8 3 0x33 0x03 000011
        9 4 0x34 0x04 000100
        10 o 0x6f 0x37 110111
        11 8 0x38 0x08 001000
        12 s 0x73 0x3b 111011
        13 d 0x64 0x2c 101100
        14 < 0x3c 0x0c 001100
        15 L 0x4c 0x1c 011100
        16 9 0x39 0x09 001001
        17 i 0x69 0x31 110001
        18 : 0x3a 0x0a 001010
        19 a 0x61 0x29 101001
        20 ; 0x3b 0x0b 001011
        21 W 0x57 0x27 100111
        22 F 0x46 0x16 010110
        23 > 0x3e 0x0e 001110
        24 0 0x30 0x00 000000
        25 6 0x36 0x06 000110
        26 2 0x32 0x02 000010
        27 D 0x44 0x14 010100

        Overlay your 6 bit bytes onto 8 bit bytes and you'll get –

        00000100 01001011 01010111 00101111 01110100 00000000 00001100
        01001101 11001000 11101110 11000011 00011100 00100111 00010010
        10101001 00101110 01110101 10001110 00000000 01100000 10010100

        Then just pick out the bit patterns to give you the various values.

        For example -

        Bits 0 – 5 = The Message ID
        Bits 8 – 37 = The MMIS Number
        .
        .
        .
        .
        Bits 62 – 89 = Longitude
        Bits 90 – 116 = Latitude
        .
        .
        .
        .
        etc.

        Using this process the message above decodes to -

        ------------ NMEA AIS Message -------------

        NMEA Message Header : !AIVDM
        Number of Sentences : 1
        Sentence Number : 1
        Sequential Message ID : 0
        AIS Channel : A
        Checksum : 0x7d
        -------------------------------------------
        Message Type : 1
        Repeat : 0
        MMSI : 316001245
        Nav. Status : 0000
        Rate of Turn : 0.0
        SOG : 19.6
        Pos. Accuracy : 1
        Longitude : 323 degrees 30 minutes
        Latitude : 49 degrees 12 minutes
        COG : 235.0
        True Heading : 235
        Message Time : 7 seconds past the minute
        Regional App. : 0000
        -------------------------------------------

        AJ

        --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
        <thormod.nordahl@...> wrote:
        >
        > Lets just take one 8bit char "E"
        >
        > E ASCII 69
        >
        > One approach:
        > 69 - 48 = 21
        > 53 -8 = 13
        > 13 = 001101
        >
        > Second approach
        > 6 bit ASCII
        >
        > E = 5
        > 5 = 000101
        >
        > Third approach
        >
        > 69 = 01000101
        > Remove 2 MSB = 000101 (Same as second approach)
        >
        > Can anybody enlighten me?
        >
        > And thanks and cudos to the creator of aismon.
        >
        > Tom
        >
      • Thormod (Tom) Nordahl
        Interesting, You too have found the error in the BosunMates parsing example. But I dont understant the need to Quote: Overlay your 6 bit bytes onto 8 bit bytes
        Message 3 of 16 , Aug 26, 2008
        • 0 Attachment
          Interesting, You too have found the error in the BosunMates parsing
          example.

          But I dont understant the need to Quote: Overlay your 6 bit bytes
          onto 8 bit bytes and you'll get –UnQuote.
          At this point we are dealing with a bitstream and I dont see the
          purpose of bunching them into bytes.

          Tom

          --- In aismon@yahoogroups.com, "lmukis" <lmukis@...> wrote:
          >
          > To decode the `data' section of an AIVDM sentence –
          >
          > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to encode
          the
          > AIS sentence. Do this by stepping through each character in turn
          and
          > subtracting 48, if the result is greater than 40, subtract another
          8.
          >
          > For Example –
          >
          > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
          >
          > 8bit 6bit
          > ------------------------
          > 0 1 0x31 0x01 000001
          > 1 4 0x34 0x04 000100
          > 2 e 0x65 0x2d 101101
          > 3 G 0x47 0x17 010111
          > 4 ; 0x3b 0x0b 001011
          > 5 o 0x6f 0x37 110111
          > 6 @ 0x40 0x10 010000
          > 7 0 0x30 0x00 000000
          > 8 3 0x33 0x03 000011
          > 9 4 0x34 0x04 000100
          > 10 o 0x6f 0x37 110111
          > 11 8 0x38 0x08 001000
          > 12 s 0x73 0x3b 111011
          > 13 d 0x64 0x2c 101100
          > 14 < 0x3c 0x0c 001100
          > 15 L 0x4c 0x1c 011100
          > 16 9 0x39 0x09 001001
          > 17 i 0x69 0x31 110001
          > 18 : 0x3a 0x0a 001010
          > 19 a 0x61 0x29 101001
          > 20 ; 0x3b 0x0b 001011
          > 21 W 0x57 0x27 100111
          > 22 F 0x46 0x16 010110
          > 23 > 0x3e 0x0e 001110
          > 24 0 0x30 0x00 000000
          > 25 6 0x36 0x06 000110
          > 26 2 0x32 0x02 000010
          > 27 D 0x44 0x14 010100
          >
          > Overlay your 6 bit bytes onto 8 bit bytes and you'll get –
          >
          > 00000100 01001011 01010111 00101111 01110100 00000000 00001100
          > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
          > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
          >
          > Then just pick out the bit patterns to give you the various values.
          >
          > For example -
          >
          > Bits 0 – 5 = The Message ID
          > Bits 8 – 37 = The MMIS Number
          > .
          > .
          > .
          > .
          > Bits 62 – 89 = Longitude
          > Bits 90 – 116 = Latitude
          > .
          > .
          > .
          > .
          > etc.
          >
          > Using this process the message above decodes to -
          >
          > ------------ NMEA AIS Message -------------
          >
          > NMEA Message Header : !AIVDM
          > Number of Sentences : 1
          > Sentence Number : 1
          > Sequential Message ID : 0
          > AIS Channel : A
          > Checksum : 0x7d
          > -------------------------------------------
          > Message Type : 1
          > Repeat : 0
          > MMSI : 316001245
          > Nav. Status : 0000
          > Rate of Turn : 0.0
          > SOG : 19.6
          > Pos. Accuracy : 1
          > Longitude : 323 degrees 30 minutes
          > Latitude : 49 degrees 12 minutes
          > COG : 235.0
          > True Heading : 235
          > Message Time : 7 seconds past the minute
          > Regional App. : 0000
          > -------------------------------------------
          >
          > AJ
          >
          > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
          > <thormod.nordahl@> wrote:
          > >
          > > Lets just take one 8bit char "E"
          > >
          > > E ASCII 69
          > >
          > > One approach:
          > > 69 - 48 = 21
          > > 53 -8 = 13
          > > 13 = 001101
          > >
          > > Second approach
          > > 6 bit ASCII
          > >
          > > E = 5
          > > 5 = 000101
          > >
          > > Third approach
          > >
          > > 69 = 01000101
          > > Remove 2 MSB = 000101 (Same as second approach)
          > >
          > > Can anybody enlighten me?
          > >
          > > And thanks and cudos to the creator of aismon.
          > >
          > > Tom
          > >
          >
        • Giuseppe Menga
          I tried to decode with my algorithm your message. Everything was fine but the longitude: I got 123°52.66 W, instead of your 323° 30 , i.e. 36° 30 W. As I
          Message 4 of 16 , Aug 26, 2008
          • 0 Attachment
            I tried to decode with my algorithm your message. Everything was fine but the longitude: I got 123°52.66' W, instead of your 323° 30', i.e. 36° 30' W.
            As I checked my algorithm in several previous examples, did I made a mistake?
            Giuseppe
            ----- Original Message -----
            From: lmukis
            Sent: Tuesday, August 26, 2008 5:23 PM
            Subject: [aismon] Re: Trying to understand the decoding of the aivdm message bytes

            To decode the `data' section of an AIVDM sentence –

            Convert the 8 bit ASCII `data' to the 6 bit ASCII used to encode the
            AIS sentence. Do this by stepping through each character in turn and
            subtracting 48, if the result is greater than 40, subtract another 8.

            For Example –

            !AIVDM,1,1,, A,14eG;o@ 034o8sd<L9i: a;WF>062D, 0*7D

            8bit 6bit
            ------------ --------- ---
            0 1 0x31 0x01 000001
            1 4 0x34 0x04 000100
            2 e 0x65 0x2d 101101
            3 G 0x47 0x17 010111
            4 ; 0x3b 0x0b 001011
            5 o 0x6f 0x37 110111
            6 @ 0x40 0x10 010000
            7 0 0x30 0x00 000000
            8 3 0x33 0x03 000011
            9 4 0x34 0x04 000100
            10 o 0x6f 0x37 110111
            11 8 0x38 0x08 001000
            12 s 0x73 0x3b 111011
            13 d 0x64 0x2c 101100
            14 < 0x3c 0x0c 001100
            15 L 0x4c 0x1c 011100
            16 9 0x39 0x09 001001
            17 i 0x69 0x31 110001
            18 : 0x3a 0x0a 001010
            19 a 0x61 0x29 101001
            20 ; 0x3b 0x0b 001011
            21 W 0x57 0x27 100111
            22 F 0x46 0x16 010110
            23 > 0x3e 0x0e 001110
            24 0 0x30 0x00 000000
            25 6 0x36 0x06 000110
            26 2 0x32 0x02 000010
            27 D 0x44 0x14 010100

            Overlay your 6 bit bytes onto 8 bit bytes and you'll get –

            00000100 01001011 01010111 00101111 01110100 00000000 00001100
            01001101 11001000 11101110 11000011 00011100 00100111 00010010
            10101001 00101110 01110101 10001110 00000000 01100000 10010100

            Then just pick out the bit patterns to give you the various values.

            For example -

            Bits 0 – 5 = The Message ID
            Bits 8 – 37 = The MMIS Number
            .
            .
            .
            .
            Bits 62 – 89 = Longitude
            Bits 90 – 116 = Latitude
            .
            .
            .
            .
            etc.

            Using this process the message above decodes to -

            ------------ NMEA AIS Message ------------ -

            NMEA Message Header : !AIVDM
            Number of Sentences : 1
            Sentence Number : 1
            Sequential Message ID : 0
            AIS Channel : A
            Checksum : 0x7d
            ------------ --------- --------- --------- ----
            Message Type : 1
            Repeat : 0
            MMSI : 316001245
            Nav. Status : 0000
            Rate of Turn : 0.0
            SOG : 19.6
            Pos. Accuracy : 1
            Longitude : 323 degrees 30 minutes
            Latitude : 49 degrees 12 minutes
            COG : 235.0
            True Heading : 235
            Message Time : 7 seconds past the minute
            Regional App. : 0000
            ------------ --------- --------- --------- ----

            AJ

            --- In aismon@yahoogroups. com, "Thormod (Tom) Nordahl"
            <thormod.nordahl@ ...> wrote:
            >
            > Lets just take one 8bit char "E"
            >
            > E ASCII 69
            >
            > One approach:
            > 69 - 48 = 21
            > 53 -8 = 13
            > 13 = 001101
            >
            > Second approach
            > 6 bit ASCII
            >
            > E = 5
            > 5 = 000101
            >
            > Third approach
            >
            > 69 = 01000101
            > Remove 2 MSB = 000101 (Same as second approach)
            >
            > Can anybody enlighten me?
            >
            > And thanks and cudos to the creator of aismon.
            >
            > Tom
            >

          • lmukis
            Giuseppe No - don t touch a thing, looks like it was my mistake – I didn t realise that latitude and longitude are signed binary numbers. When I take the
            Message 5 of 16 , Aug 27, 2008
            • 0 Attachment
              Giuseppe

              No - don't touch a thing, looks like it was my mistake – I didn't
              realise that latitude and longitude are signed binary numbers.

              When I take the twos compliment of my longitude value I too get 123°
              52.66'W

              My apologies for the confusion. (That's what happens when you're only
              source of reference is Google Ooops I mean Yahoo)

              Are you taking you're information from ITU 1371?

              AJ

              --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@...> wrote:
              >
              > I tried to decode with my algorithm your message. Everything was
              fine but the longitude: I got 123°52.66' W, instead of your 323° 30',
              i.e. 36° 30' W.
              > As I checked my algorithm in several previous examples, did I made
              a mistake?
              > Giuseppe
              > ----- Original Message -----
              > From: lmukis
              > To: aismon@yahoogroups.com
              > Sent: Tuesday, August 26, 2008 5:23 PM
              > Subject: [aismon] Re: Trying to understand the decoding of the
              aivdm message bytes
              >
              >
              > To decode the `data' section of an AIVDM sentence -
              >
              > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to encode
              the
              > AIS sentence. Do this by stepping through each character in turn
              and
              > subtracting 48, if the result is greater than 40, subtract
              another 8.
              >
              > For Example -
              >
              > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
              >
              > 8bit 6bit
              > ------------------------
              > 0 1 0x31 0x01 000001
              > 1 4 0x34 0x04 000100
              > 2 e 0x65 0x2d 101101
              > 3 G 0x47 0x17 010111
              > 4 ; 0x3b 0x0b 001011
              > 5 o 0x6f 0x37 110111
              > 6 @ 0x40 0x10 010000
              > 7 0 0x30 0x00 000000
              > 8 3 0x33 0x03 000011
              > 9 4 0x34 0x04 000100
              > 10 o 0x6f 0x37 110111
              > 11 8 0x38 0x08 001000
              > 12 s 0x73 0x3b 111011
              > 13 d 0x64 0x2c 101100
              > 14 < 0x3c 0x0c 001100
              > 15 L 0x4c 0x1c 011100
              > 16 9 0x39 0x09 001001
              > 17 i 0x69 0x31 110001
              > 18 : 0x3a 0x0a 001010
              > 19 a 0x61 0x29 101001
              > 20 ; 0x3b 0x0b 001011
              > 21 W 0x57 0x27 100111
              > 22 F 0x46 0x16 010110
              > 23 > 0x3e 0x0e 001110
              > 24 0 0x30 0x00 000000
              > 25 6 0x36 0x06 000110
              > 26 2 0x32 0x02 000010
              > 27 D 0x44 0x14 010100
              >
              > Overlay your 6 bit bytes onto 8 bit bytes and you'll get -
              >
              > 00000100 01001011 01010111 00101111 01110100 00000000 00001100
              > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
              > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
              >
              > Then just pick out the bit patterns to give you the various
              values.
              >
              > For example -
              >
              > Bits 0 - 5 = The Message ID
              > Bits 8 - 37 = The MMIS Number
              > .
              > .
              > .
              > .
              > Bits 62 - 89 = Longitude
              > Bits 90 - 116 = Latitude
              > .
              > .
              > .
              > .
              > etc.
              >
              > Using this process the message above decodes to -
              >
              > ------------ NMEA AIS Message -------------
              >
              > NMEA Message Header : !AIVDM
              > Number of Sentences : 1
              > Sentence Number : 1
              > Sequential Message ID : 0
              > AIS Channel : A
              > Checksum : 0x7d
              > -------------------------------------------
              > Message Type : 1
              > Repeat : 0
              > MMSI : 316001245
              > Nav. Status : 0000
              > Rate of Turn : 0.0
              > SOG : 19.6
              > Pos. Accuracy : 1
              > Longitude : 323 degrees 30 minutes
              > Latitude : 49 degrees 12 minutes
              > COG : 235.0
              > True Heading : 235
              > Message Time : 7 seconds past the minute
              > Regional App. : 0000
              > -------------------------------------------
              >
              > AJ
              >
              > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
              > <thormod.nordahl@> wrote:
              > >
              > > Lets just take one 8bit char "E"
              > >
              > > E ASCII 69
              > >
              > > One approach:
              > > 69 - 48 = 21
              > > 53 -8 = 13
              > > 13 = 001101
              > >
              > > Second approach
              > > 6 bit ASCII
              > >
              > > E = 5
              > > 5 = 000101
              > >
              > > Third approach
              > >
              > > 69 = 01000101
              > > Remove 2 MSB = 000101 (Same as second approach)
              > >
              > > Can anybody enlighten me?
              > >
              > > And thanks and cudos to the creator of aismon.
              > >
              > > Tom
              > >
              >
            • Giuseppe Menga
              Yes, I read ITU 1371_1 Giuseppe ... From: lmukis To: aismon@yahoogroups.com Sent: Wednesday, August 27, 2008 4:35 PM Subject: [aismon] Re: Trying to understand
              Message 6 of 16 , Aug 27, 2008
              • 0 Attachment
                Yes, I read ITU 1371_1
                Giuseppe
                ----- Original Message -----
                From: lmukis
                Sent: Wednesday, August 27, 2008 4:35 PM
                Subject: [aismon] Re: Trying to understand the decoding of the aivdm message bytes

                Giuseppe

                No - don't touch a thing, looks like it was my mistake – I didn't
                realise that latitude and longitude are signed binary numbers.

                When I take the twos compliment of my longitude value I too get 123°
                52.66'W

                My apologies for the confusion. (That's what happens when you're only
                source of reference is Google Ooops I mean Yahoo)

                Are you taking you're information from ITU 1371?

                AJ

                --- In aismon@yahoogroups. com, "Giuseppe Menga" <menga@...> wrote:
                >
                > I tried to decode with my algorithm your message. Everything was
                fine but the longitude: I got 123°52.66' W, instead of your 323° 30',
                i.e. 36° 30' W.
                > As I checked my algorithm in several previous examples, did I made
                a mistake?
                > Giuseppe
                > ----- Original Message -----
                > From: lmukis
                > To: aismon@yahoogroups. com
                > Sent: Tuesday, August 26, 2008 5:23 PM
                > Subject: [aismon] Re: Trying to understand the decoding of the
                aivdm message bytes
                >
                >
                > To decode the `data' section of an AIVDM sentence -
                >
                > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to encode
                the
                > AIS sentence. Do this by stepping through each character in turn
                and
                > subtracting 48, if the result is greater than 40, subtract
                another 8.
                >
                > For Example -
                >
                > !AIVDM,1,1,, A,14eG;o@ 034o8sd<L9i: a;WF>062D, 0*7D
                >
                > 8bit 6bit
                > ------------ --------- ---
                > 0 1 0x31 0x01 000001
                > 1 4 0x34 0x04 000100
                > 2 e 0x65 0x2d 101101
                > 3 G 0x47 0x17 010111
                > 4 ; 0x3b 0x0b 001011
                > 5 o 0x6f 0x37 110111
                > 6 @ 0x40 0x10 010000
                > 7 0 0x30 0x00 000000
                > 8 3 0x33 0x03 000011
                > 9 4 0x34 0x04 000100
                > 10 o 0x6f 0x37 110111
                > 11 8 0x38 0x08 001000
                > 12 s 0x73 0x3b 111011
                > 13 d 0x64 0x2c 101100
                > 14 < 0x3c 0x0c 001100
                > 15 L 0x4c 0x1c 011100
                > 16 9 0x39 0x09 001001
                > 17 i 0x69 0x31 110001
                > 18 : 0x3a 0x0a 001010
                > 19 a 0x61 0x29 101001
                > 20 ; 0x3b 0x0b 001011
                > 21 W 0x57 0x27 100111
                > 22 F 0x46 0x16 010110
                > 23 > 0x3e 0x0e 001110
                > 24 0 0x30 0x00 000000
                > 25 6 0x36 0x06 000110
                > 26 2 0x32 0x02 000010
                > 27 D 0x44 0x14 010100
                >
                > Overlay your 6 bit bytes onto 8 bit bytes and you'll get -
                >
                > 00000100 01001011 01010111 00101111 01110100 00000000 00001100
                > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
                > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
                >
                > Then just pick out the bit patterns to give you the various
                values.
                >
                > For example -
                >
                > Bits 0 - 5 = The Message ID
                > Bits 8 - 37 = The MMIS Number
                > .
                > .
                > .
                > .
                > Bits 62 - 89 = Longitude
                > Bits 90 - 116 = Latitude
                > .
                > .
                > .
                > .
                > etc.
                >
                > Using this process the message above decodes to -
                >
                > ------------ NMEA AIS Message ------------ -
                >
                > NMEA Message Header : !AIVDM
                > Number of Sentences : 1
                > Sentence Number : 1
                > Sequential Message ID : 0
                > AIS Channel : A
                > Checksum : 0x7d
                > ------------ --------- --------- --------- ----
                > Message Type : 1
                > Repeat : 0
                > MMSI : 316001245
                > Nav. Status : 0000
                > Rate of Turn : 0.0
                > SOG : 19.6
                > Pos. Accuracy : 1
                > Longitude : 323 degrees 30 minutes
                > Latitude : 49 degrees 12 minutes
                > COG : 235.0
                > True Heading : 235
                > Message Time : 7 seconds past the minute
                > Regional App. : 0000
                > ------------ --------- --------- --------- ----
                >
                > AJ
                >
                > --- In aismon@yahoogroups. com, "Thormod (Tom) Nordahl"
                > <thormod.nordahl@ > wrote:
                > >
                > > Lets just take one 8bit char "E"
                > >
                > > E ASCII 69
                > >
                > > One approach:
                > > 69 - 48 = 21
                > > 53 -8 = 13
                > > 13 = 001101
                > >
                > > Second approach
                > > 6 bit ASCII
                > >
                > > E = 5
                > > 5 = 000101
                > >
                > > Third approach
                > >
                > > 69 = 01000101
                > > Remove 2 MSB = 000101 (Same as second approach)
                > >
                > > Can anybody enlighten me?
                > >
                > > And thanks and cudos to the creator of aismon.
                > >
                > > Tom
                > >
                >

              • JensNL
                I don t know if it s a mistake that you can download this file It s old but have all the Class A info you need. I hope the link works I just googled 61993 and
                Message 7 of 16 , Aug 27, 2008
                • 0 Attachment
                  I don't know if it's a mistake that you can download this file
                  It's old but have all the Class A info you need.
                  I hope the link works I just googled 61993 and it was the 3. link

                  http://www.tdcom.fr/support/index.php?dir=Sailor%2FAIS-1%2FDocuments%
                  2FIEC+doc%2F&download=iec61993-2%7Bed1.0%7Den.pdf

                  --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@...> wrote:
                  >
                  > Yes, I read ITU 1371_1
                  > Giuseppe
                  > ----- Original Message -----
                  > From: lmukis
                  > To: aismon@yahoogroups.com
                  > Sent: Wednesday, August 27, 2008 4:35 PM
                  > Subject: [aismon] Re: Trying to understand the decoding of the
                  aivdm message bytes
                  >
                  >
                  > Giuseppe
                  >
                  > No - don't touch a thing, looks like it was my mistake - I
                  didn't
                  > realise that latitude and longitude are signed binary numbers.
                  >
                  > When I take the twos compliment of my longitude value I too get
                  123°
                  > 52.66'W
                  >
                  > My apologies for the confusion. (That's what happens when you're
                  only
                  > source of reference is Google Ooops I mean Yahoo)
                  >
                  > Are you taking you're information from ITU 1371?
                  >
                  > AJ
                  >
                  > --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@> wrote:
                  > >
                  > > I tried to decode with my algorithm your message. Everything
                  was
                  > fine but the longitude: I got 123°52.66' W, instead of your 323°
                  30',
                  > i.e. 36° 30' W.
                  > > As I checked my algorithm in several previous examples, did I
                  made
                  > a mistake?
                  > > Giuseppe
                  > > ----- Original Message -----
                  > > From: lmukis
                  > > To: aismon@yahoogroups.com
                  > > Sent: Tuesday, August 26, 2008 5:23 PM
                  > > Subject: [aismon] Re: Trying to understand the decoding of the
                  > aivdm message bytes
                  > >
                  > >
                  > > To decode the `data' section of an AIVDM sentence -
                  > >
                  > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to
                  encode
                  > the
                  > > AIS sentence. Do this by stepping through each character in
                  turn
                  > and
                  > > subtracting 48, if the result is greater than 40, subtract
                  > another 8.
                  > >
                  > > For Example -
                  > >
                  > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                  > >
                  > > 8bit 6bit
                  > > ------------------------
                  > > 0 1 0x31 0x01 000001
                  > > 1 4 0x34 0x04 000100
                  > > 2 e 0x65 0x2d 101101
                  > > 3 G 0x47 0x17 010111
                  > > 4 ; 0x3b 0x0b 001011
                  > > 5 o 0x6f 0x37 110111
                  > > 6 @ 0x40 0x10 010000
                  > > 7 0 0x30 0x00 000000
                  > > 8 3 0x33 0x03 000011
                  > > 9 4 0x34 0x04 000100
                  > > 10 o 0x6f 0x37 110111
                  > > 11 8 0x38 0x08 001000
                  > > 12 s 0x73 0x3b 111011
                  > > 13 d 0x64 0x2c 101100
                  > > 14 < 0x3c 0x0c 001100
                  > > 15 L 0x4c 0x1c 011100
                  > > 16 9 0x39 0x09 001001
                  > > 17 i 0x69 0x31 110001
                  > > 18 : 0x3a 0x0a 001010
                  > > 19 a 0x61 0x29 101001
                  > > 20 ; 0x3b 0x0b 001011
                  > > 21 W 0x57 0x27 100111
                  > > 22 F 0x46 0x16 010110
                  > > 23 > 0x3e 0x0e 001110
                  > > 24 0 0x30 0x00 000000
                  > > 25 6 0x36 0x06 000110
                  > > 26 2 0x32 0x02 000010
                  > > 27 D 0x44 0x14 010100
                  > >
                  > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get -
                  > >
                  > > 00000100 01001011 01010111 00101111 01110100 00000000 00001100
                  > > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
                  > > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
                  > >
                  > > Then just pick out the bit patterns to give you the various
                  > values.
                  > >
                  > > For example -
                  > >
                  > > Bits 0 - 5 = The Message ID
                  > > Bits 8 - 37 = The MMIS Number
                  > > .
                  > > .
                  > > .
                  > > .
                  > > Bits 62 - 89 = Longitude
                  > > Bits 90 - 116 = Latitude
                  > > .
                  > > .
                  > > .
                  > > .
                  > > etc.
                  > >
                  > > Using this process the message above decodes to -
                  > >
                  > > ------------ NMEA AIS Message -------------
                  > >
                  > > NMEA Message Header : !AIVDM
                  > > Number of Sentences : 1
                  > > Sentence Number : 1
                  > > Sequential Message ID : 0
                  > > AIS Channel : A
                  > > Checksum : 0x7d
                  > > -------------------------------------------
                  > > Message Type : 1
                  > > Repeat : 0
                  > > MMSI : 316001245
                  > > Nav. Status : 0000
                  > > Rate of Turn : 0.0
                  > > SOG : 19.6
                  > > Pos. Accuracy : 1
                  > > Longitude : 323 degrees 30 minutes
                  > > Latitude : 49 degrees 12 minutes
                  > > COG : 235.0
                  > > True Heading : 235
                  > > Message Time : 7 seconds past the minute
                  > > Regional App. : 0000
                  > > -------------------------------------------
                  > >
                  > > AJ
                  > >
                  > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                  > > <thormod.nordahl@> wrote:
                  > > >
                  > > > Lets just take one 8bit char "E"
                  > > >
                  > > > E ASCII 69
                  > > >
                  > > > One approach:
                  > > > 69 - 48 = 21
                  > > > 53 -8 = 13
                  > > > 13 = 001101
                  > > >
                  > > > Second approach
                  > > > 6 bit ASCII
                  > > >
                  > > > E = 5
                  > > > 5 = 000101
                  > > >
                  > > > Third approach
                  > > >
                  > > > 69 = 01000101
                  > > > Remove 2 MSB = 000101 (Same as second approach)
                  > > >
                  > > > Can anybody enlighten me?
                  > > >
                  > > > And thanks and cudos to the creator of aismon.
                  > > >
                  > > > Tom
                  > > >
                  > >
                  >
                • lmukis
                  Hi Tom I wanted to use an unsigned character array to handle the data and decided to pack the 6 bit bytes into the array. I then have a simple routine to
                  Message 8 of 16 , Aug 28, 2008
                  • 0 Attachment
                    Hi Tom

                    I wanted to use an unsigned character array to handle the data and
                    decided to pack the 6 bit bytes into the array. I then have a simple
                    routine to extract the required bits given the first and last bit
                    positions (i.e. 89-115 for Latitude) I needed to keep the code basic
                    (NOT B.A.S.I.C!) as I suspect I may have to port this to an embedded
                    ADA environment.
                    I'm sure others have better methods of doing the bit manipulation and
                    I always welcome suggestions.

                    One area I'm currently stuck on is the rate of turn calculation (b42-
                    b49 deg/min) If anyone can enlighten me I'd be most appreciative.

                    AJ


                    --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                    <thormod.nordahl@...> wrote:
                    >
                    > Interesting, You too have found the error in the BosunMates parsing
                    > example.
                    >
                    > But I dont understant the need to Quote: Overlay your 6 bit bytes
                    > onto 8 bit bytes and you'll get –UnQuote.
                    > At this point we are dealing with a bitstream and I dont see the
                    > purpose of bunching them into bytes.
                    >
                    > Tom
                    >
                    > --- In aismon@yahoogroups.com, "lmukis" <lmukis@> wrote:
                    > >
                    > > To decode the `data' section of an AIVDM sentence –
                    > >
                    > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to encode
                    > the
                    > > AIS sentence. Do this by stepping through each character in turn
                    > and
                    > > subtracting 48, if the result is greater than 40, subtract
                    another
                    > 8.
                    > >
                    > > For Example –
                    > >
                    > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                    > >
                    > > 8bit 6bit
                    > > ------------------------
                    > > 0 1 0x31 0x01 000001
                    > > 1 4 0x34 0x04 000100
                    > > 2 e 0x65 0x2d 101101
                    > > 3 G 0x47 0x17 010111
                    > > 4 ; 0x3b 0x0b 001011
                    > > 5 o 0x6f 0x37 110111
                    > > 6 @ 0x40 0x10 010000
                    > > 7 0 0x30 0x00 000000
                    > > 8 3 0x33 0x03 000011
                    > > 9 4 0x34 0x04 000100
                    > > 10 o 0x6f 0x37 110111
                    > > 11 8 0x38 0x08 001000
                    > > 12 s 0x73 0x3b 111011
                    > > 13 d 0x64 0x2c 101100
                    > > 14 < 0x3c 0x0c 001100
                    > > 15 L 0x4c 0x1c 011100
                    > > 16 9 0x39 0x09 001001
                    > > 17 i 0x69 0x31 110001
                    > > 18 : 0x3a 0x0a 001010
                    > > 19 a 0x61 0x29 101001
                    > > 20 ; 0x3b 0x0b 001011
                    > > 21 W 0x57 0x27 100111
                    > > 22 F 0x46 0x16 010110
                    > > 23 > 0x3e 0x0e 001110
                    > > 24 0 0x30 0x00 000000
                    > > 25 6 0x36 0x06 000110
                    > > 26 2 0x32 0x02 000010
                    > > 27 D 0x44 0x14 010100
                    > >
                    > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get –
                    > >
                    > > 00000100 01001011 01010111 00101111 01110100 00000000 00001100
                    > > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
                    > > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
                    > >
                    > > Then just pick out the bit patterns to give you the various
                    values.
                    > >
                    > > For example -
                    > >
                    > > Bits 0 – 5 = The Message ID
                    > > Bits 8 – 37 = The MMIS Number
                    > > .
                    > > .
                    > > .
                    > > .
                    > > Bits 62 – 89 = Longitude
                    > > Bits 90 – 116 = Latitude
                    > > .
                    > > .
                    > > .
                    > > .
                    > > etc.
                    > >
                    > > Using this process the message above decodes to -
                    > >
                    > > ------------ NMEA AIS Message -------------
                    > >
                    > > NMEA Message Header : !AIVDM
                    > > Number of Sentences : 1
                    > > Sentence Number : 1
                    > > Sequential Message ID : 0
                    > > AIS Channel : A
                    > > Checksum : 0x7d
                    > > -------------------------------------------
                    > > Message Type : 1
                    > > Repeat : 0
                    > > MMSI : 316001245
                    > > Nav. Status : 0000
                    > > Rate of Turn : 0.0
                    > > SOG : 19.6
                    > > Pos. Accuracy : 1
                    > > Longitude : 323 degrees 30 minutes
                    > > Latitude : 49 degrees 12 minutes
                    > > COG : 235.0
                    > > True Heading : 235
                    > > Message Time : 7 seconds past the minute
                    > > Regional App. : 0000
                    > > -------------------------------------------
                    > >
                    > > AJ
                    > >
                    > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                    > > <thormod.nordahl@> wrote:
                    > > >
                    > > > Lets just take one 8bit char "E"
                    > > >
                    > > > E ASCII 69
                    > > >
                    > > > One approach:
                    > > > 69 - 48 = 21
                    > > > 53 -8 = 13
                    > > > 13 = 001101
                    > > >
                    > > > Second approach
                    > > > 6 bit ASCII
                    > > >
                    > > > E = 5
                    > > > 5 = 000101
                    > > >
                    > > > Third approach
                    > > >
                    > > > 69 = 01000101
                    > > > Remove 2 MSB = 000101 (Same as second approach)
                    > > >
                    > > > Can anybody enlighten me?
                    > > >
                    > > > And thanks and cudos to the creator of aismon.
                    > > >
                    > > > Tom
                    > > >
                    > >
                    >
                  • lmukis
                    Thanks for the info. I ll try the link as soon as I get home. Looks like I ve managed to talk my company into purchasing IEC 61993- 2, ITU M1371-3 and NMEA
                    Message 9 of 16 , Aug 28, 2008
                    • 0 Attachment
                      Thanks for the info. I'll try the link as soon as I get home.

                      Looks like I've managed to talk my company into purchasing IEC 61993-
                      2, ITU M1371-3 and NMEA 0183 v 3

                      If anyone can suggest any other documents that might be useful please
                      let me know. I'd like to get the order in while management is still
                      in a good mood!

                      AJ


                      --- In aismon@yahoogroups.com, "JensNL" <jensnl@...> wrote:
                      >
                      > I don't know if it's a mistake that you can download this file
                      > It's old but have all the Class A info you need.
                      > I hope the link works I just googled 61993 and it was the 3. link
                      >
                      > http://www.tdcom.fr/support/index.php?dir=Sailor%2FAIS-1%
                      2FDocuments%
                      > 2FIEC+doc%2F&download=iec61993-2%7Bed1.0%7Den.pdf
                      >
                      > --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@> wrote:
                      > >
                      > > Yes, I read ITU 1371_1
                      > > Giuseppe
                      > > ----- Original Message -----
                      > > From: lmukis
                      > > To: aismon@yahoogroups.com
                      > > Sent: Wednesday, August 27, 2008 4:35 PM
                      > > Subject: [aismon] Re: Trying to understand the decoding of the
                      > aivdm message bytes
                      > >
                      > >
                      > > Giuseppe
                      > >
                      > > No - don't touch a thing, looks like it was my mistake - I
                      > didn't
                      > > realise that latitude and longitude are signed binary numbers.
                      > >
                      > > When I take the twos compliment of my longitude value I too get
                      > 123°
                      > > 52.66'W
                      > >
                      > > My apologies for the confusion. (That's what happens when
                      you're
                      > only
                      > > source of reference is Google Ooops I mean Yahoo)
                      > >
                      > > Are you taking you're information from ITU 1371?
                      > >
                      > > AJ
                      > >
                      > > --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@> wrote:
                      > > >
                      > > > I tried to decode with my algorithm your message. Everything
                      > was
                      > > fine but the longitude: I got 123°52.66' W, instead of your
                      323°
                      > 30',
                      > > i.e. 36° 30' W.
                      > > > As I checked my algorithm in several previous examples, did I
                      > made
                      > > a mistake?
                      > > > Giuseppe
                      > > > ----- Original Message -----
                      > > > From: lmukis
                      > > > To: aismon@yahoogroups.com
                      > > > Sent: Tuesday, August 26, 2008 5:23 PM
                      > > > Subject: [aismon] Re: Trying to understand the decoding of
                      the
                      > > aivdm message bytes
                      > > >
                      > > >
                      > > > To decode the `data' section of an AIVDM sentence -
                      > > >
                      > > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to
                      > encode
                      > > the
                      > > > AIS sentence. Do this by stepping through each character in
                      > turn
                      > > and
                      > > > subtracting 48, if the result is greater than 40, subtract
                      > > another 8.
                      > > >
                      > > > For Example -
                      > > >
                      > > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                      > > >
                      > > > 8bit 6bit
                      > > > ------------------------
                      > > > 0 1 0x31 0x01 000001
                      > > > 1 4 0x34 0x04 000100
                      > > > 2 e 0x65 0x2d 101101
                      > > > 3 G 0x47 0x17 010111
                      > > > 4 ; 0x3b 0x0b 001011
                      > > > 5 o 0x6f 0x37 110111
                      > > > 6 @ 0x40 0x10 010000
                      > > > 7 0 0x30 0x00 000000
                      > > > 8 3 0x33 0x03 000011
                      > > > 9 4 0x34 0x04 000100
                      > > > 10 o 0x6f 0x37 110111
                      > > > 11 8 0x38 0x08 001000
                      > > > 12 s 0x73 0x3b 111011
                      > > > 13 d 0x64 0x2c 101100
                      > > > 14 < 0x3c 0x0c 001100
                      > > > 15 L 0x4c 0x1c 011100
                      > > > 16 9 0x39 0x09 001001
                      > > > 17 i 0x69 0x31 110001
                      > > > 18 : 0x3a 0x0a 001010
                      > > > 19 a 0x61 0x29 101001
                      > > > 20 ; 0x3b 0x0b 001011
                      > > > 21 W 0x57 0x27 100111
                      > > > 22 F 0x46 0x16 010110
                      > > > 23 > 0x3e 0x0e 001110
                      > > > 24 0 0x30 0x00 000000
                      > > > 25 6 0x36 0x06 000110
                      > > > 26 2 0x32 0x02 000010
                      > > > 27 D 0x44 0x14 010100
                      > > >
                      > > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get -
                      > > >
                      > > > 00000100 01001011 01010111 00101111 01110100 00000000
                      00001100
                      > > > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
                      > > > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
                      > > >
                      > > > Then just pick out the bit patterns to give you the various
                      > > values.
                      > > >
                      > > > For example -
                      > > >
                      > > > Bits 0 - 5 = The Message ID
                      > > > Bits 8 - 37 = The MMIS Number
                      > > > .
                      > > > .
                      > > > .
                      > > > .
                      > > > Bits 62 - 89 = Longitude
                      > > > Bits 90 - 116 = Latitude
                      > > > .
                      > > > .
                      > > > .
                      > > > .
                      > > > etc.
                      > > >
                      > > > Using this process the message above decodes to -
                      > > >
                      > > > ------------ NMEA AIS Message -------------
                      > > >
                      > > > NMEA Message Header : !AIVDM
                      > > > Number of Sentences : 1
                      > > > Sentence Number : 1
                      > > > Sequential Message ID : 0
                      > > > AIS Channel : A
                      > > > Checksum : 0x7d
                      > > > -------------------------------------------
                      > > > Message Type : 1
                      > > > Repeat : 0
                      > > > MMSI : 316001245
                      > > > Nav. Status : 0000
                      > > > Rate of Turn : 0.0
                      > > > SOG : 19.6
                      > > > Pos. Accuracy : 1
                      > > > Longitude : 323 degrees 30 minutes
                      > > > Latitude : 49 degrees 12 minutes
                      > > > COG : 235.0
                      > > > True Heading : 235
                      > > > Message Time : 7 seconds past the minute
                      > > > Regional App. : 0000
                      > > > -------------------------------------------
                      > > >
                      > > > AJ
                      > > >
                      > > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                      > > > <thormod.nordahl@> wrote:
                      > > > >
                      > > > > Lets just take one 8bit char "E"
                      > > > >
                      > > > > E ASCII 69
                      > > > >
                      > > > > One approach:
                      > > > > 69 - 48 = 21
                      > > > > 53 -8 = 13
                      > > > > 13 = 001101
                      > > > >
                      > > > > Second approach
                      > > > > 6 bit ASCII
                      > > > >
                      > > > > E = 5
                      > > > > 5 = 000101
                      > > > >
                      > > > > Third approach
                      > > > >
                      > > > > 69 = 01000101
                      > > > > Remove 2 MSB = 000101 (Same as second approach)
                      > > > >
                      > > > > Can anybody enlighten me?
                      > > > >
                      > > > > And thanks and cudos to the creator of aismon.
                      > > > >
                      > > > > Tom
                      > > > >
                      > > >
                      > >
                      >
                    • Thormod (Tom) Nordahl
                      Hi AJ Thanks for the explanation. I m doing it differently, since I do ues Basic (VB) I wrote a simple function that converts the data to a bitstring. VB is
                      Message 10 of 16 , Aug 28, 2008
                      • 0 Attachment
                        Hi AJ
                        Thanks for the explanation. I'm doing it differently, since I do ues
                        Basic (VB) I wrote a simple function that converts the data to a
                        bitstring. VB is excellent at manipulating strings and I use MiD$ to
                        return the spesified number of bits. I then use en other function to
                        convert that bitstring into its value. More code, but works fine.

                        ROT
                        I get 4 BitStreams 00000000, 10000000,10000001 and 01111111
                        Representing signed single Byte numbers as I understand it.

                        0 is selfexplanatory (although not in accordance with 1371).
                        10000000 Hex 80 -127 Default, not available
                        10000001 -127 turning left faster than 720 deg/min
                        01111111 127 turning right faster than 720 deg/min

                        But,the meaning of:
                        Coded by ROTAIS=4.733 SQRT(ROTINDICATED) degrees/min
                        ROTINDICATED is the Rate of Turn (720 degrees per minute), as
                        indicated by an external sensor.
                        eludes me.

                        Tom

                        Please, when you get 1371-3, I'd love to have the protocol for Msg ID
                        24.

                        --- In aismon@yahoogroups.com, "lmukis" <lmukis@...> wrote:
                        >
                        > Hi Tom
                        >
                        > I wanted to use an unsigned character array to handle the data and
                        > decided to pack the 6 bit bytes into the array. I then have a
                        simple
                        > routine to extract the required bits given the first and last bit
                        > positions (i.e. 89-115 for Latitude) I needed to keep the code
                        basic
                        > (NOT B.A.S.I.C!) as I suspect I may have to port this to an
                        embedded
                        > ADA environment.
                        > I'm sure others have better methods of doing the bit manipulation
                        and
                        > I always welcome suggestions.
                        >
                        > One area I'm currently stuck on is the rate of turn calculation
                        (b42-
                        > b49 deg/min) If anyone can enlighten me I'd be most appreciative.
                        >
                        > AJ
                        >
                        >
                        > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                        > <thormod.nordahl@> wrote:
                        > >
                        > > Interesting, You too have found the error in the BosunMates
                        parsing
                        > > example.
                        > >
                        > > But I dont understant the need to Quote: Overlay your 6 bit bytes
                        > > onto 8 bit bytes and you'll get –UnQuote.
                        > > At this point we are dealing with a bitstream and I dont see the
                        > > purpose of bunching them into bytes.
                        > >
                        > > Tom
                        > >
                        > > --- In aismon@yahoogroups.com, "lmukis" <lmukis@> wrote:
                        > > >
                        > > > To decode the `data' section of an AIVDM sentence –
                        > > >
                        > > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to
                        encode
                        > > the
                        > > > AIS sentence. Do this by stepping through each character in
                        turn
                        > > and
                        > > > subtracting 48, if the result is greater than 40, subtract
                        > another
                        > > 8.
                        > > >
                        > > > For Example –
                        > > >
                        > > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                        > > >
                        > > > 8bit 6bit
                        > > > ------------------------
                        > > > 0 1 0x31 0x01 000001
                        > > > 1 4 0x34 0x04 000100
                        > > > 2 e 0x65 0x2d 101101
                        > > > 3 G 0x47 0x17 010111
                        > > > 4 ; 0x3b 0x0b 001011
                        > > > 5 o 0x6f 0x37 110111
                        > > > 6 @ 0x40 0x10 010000
                        > > > 7 0 0x30 0x00 000000
                        > > > 8 3 0x33 0x03 000011
                        > > > 9 4 0x34 0x04 000100
                        > > > 10 o 0x6f 0x37 110111
                        > > > 11 8 0x38 0x08 001000
                        > > > 12 s 0x73 0x3b 111011
                        > > > 13 d 0x64 0x2c 101100
                        > > > 14 < 0x3c 0x0c 001100
                        > > > 15 L 0x4c 0x1c 011100
                        > > > 16 9 0x39 0x09 001001
                        > > > 17 i 0x69 0x31 110001
                        > > > 18 : 0x3a 0x0a 001010
                        > > > 19 a 0x61 0x29 101001
                        > > > 20 ; 0x3b 0x0b 001011
                        > > > 21 W 0x57 0x27 100111
                        > > > 22 F 0x46 0x16 010110
                        > > > 23 > 0x3e 0x0e 001110
                        > > > 24 0 0x30 0x00 000000
                        > > > 25 6 0x36 0x06 000110
                        > > > 26 2 0x32 0x02 000010
                        > > > 27 D 0x44 0x14 010100
                        > > >
                        > > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get –
                        > > >
                        > > > 00000100 01001011 01010111 00101111 01110100 00000000 00001100
                        > > > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
                        > > > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
                        > > >
                        > > > Then just pick out the bit patterns to give you the various
                        > values.
                        > > >
                        > > > For example -
                        > > >
                        > > > Bits 0 – 5 = The Message ID
                        > > > Bits 8 – 37 = The MMIS Number
                        > > > .
                        > > > .
                        > > > .
                        > > > .
                        > > > Bits 62 – 89 = Longitude
                        > > > Bits 90 – 116 = Latitude
                        > > > .
                        > > > .
                        > > > .
                        > > > .
                        > > > etc.
                        > > >
                        > > > Using this process the message above decodes to -
                        > > >
                        > > > ------------ NMEA AIS Message -------------
                        > > >
                        > > > NMEA Message Header : !AIVDM
                        > > > Number of Sentences : 1
                        > > > Sentence Number : 1
                        > > > Sequential Message ID : 0
                        > > > AIS Channel : A
                        > > > Checksum : 0x7d
                        > > > -------------------------------------------
                        > > > Message Type : 1
                        > > > Repeat : 0
                        > > > MMSI : 316001245
                        > > > Nav. Status : 0000
                        > > > Rate of Turn : 0.0
                        > > > SOG : 19.6
                        > > > Pos. Accuracy : 1
                        > > > Longitude : 323 degrees 30 minutes
                        > > > Latitude : 49 degrees 12 minutes
                        > > > COG : 235.0
                        > > > True Heading : 235
                        > > > Message Time : 7 seconds past the minute
                        > > > Regional App. : 0000
                        > > > -------------------------------------------
                        > > >
                        > > > AJ
                        > > >
                        > > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                        > > > <thormod.nordahl@> wrote:
                        > > > >
                        > > > > Lets just take one 8bit char "E"
                        > > > >
                        > > > > E ASCII 69
                        > > > >
                        > > > > One approach:
                        > > > > 69 - 48 = 21
                        > > > > 53 -8 = 13
                        > > > > 13 = 001101
                        > > > >
                        > > > > Second approach
                        > > > > 6 bit ASCII
                        > > > >
                        > > > > E = 5
                        > > > > 5 = 000101
                        > > > >
                        > > > > Third approach
                        > > > >
                        > > > > 69 = 01000101
                        > > > > Remove 2 MSB = 000101 (Same as second approach)
                        > > > >
                        > > > > Can anybody enlighten me?
                        > > > >
                        > > > > And thanks and cudos to the creator of aismon.
                        > > > >
                        > > > > Tom
                        > > > >
                        > > >
                        > >
                        >
                      • JensNL
                        If you need the Class B stuff you will need 62287 I can t find it but about 2 yers ago I downloaded a draft version For the text string (6 bit letters) I made
                        Message 11 of 16 , Aug 28, 2008
                        • 0 Attachment
                          If you need the Class B stuff you will need 62287
                          I can't find it but about 2 yers ago I downloaded a draft version

                          For the text string (6 bit letters) I made function that take a
                          format string That look like this 6,31,-27,-28, .... (I don't rember
                          the numbers) and the output is a linked list where first element is
                          6 bit unsigned then 31 bit unsigned, then 27bit signed etc. then
                          it's easy to add new message types.


                          --- In aismon@yahoogroups.com, "lmukis" <lmukis@...> wrote:
                          >
                          > Thanks for the info. I'll try the link as soon as I get home.
                          >
                          > Looks like I've managed to talk my company into purchasing IEC
                          61993-
                          > 2, ITU M1371-3 and NMEA 0183 v 3
                          >
                          > If anyone can suggest any other documents that might be useful
                          please
                          > let me know. I'd like to get the order in while management is
                          still
                          > in a good mood!
                          >
                          > AJ
                          >
                          >
                          > --- In aismon@yahoogroups.com, "JensNL" <jensnl@> wrote:
                          > >
                          > > I don't know if it's a mistake that you can download this file
                          > > It's old but have all the Class A info you need.
                          > > I hope the link works I just googled 61993 and it was the 3. link
                          > >
                          > > http://www.tdcom.fr/support/index.php?dir=Sailor%2FAIS-1%
                          > 2FDocuments%
                          > > 2FIEC+doc%2F&download=iec61993-2%7Bed1.0%7Den.pdf
                          > >
                          > > --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@> wrote:
                          > > >
                          > > > Yes, I read ITU 1371_1
                          > > > Giuseppe
                          > > > ----- Original Message -----
                          > > > From: lmukis
                          > > > To: aismon@yahoogroups.com
                          > > > Sent: Wednesday, August 27, 2008 4:35 PM
                          > > > Subject: [aismon] Re: Trying to understand the decoding of
                          the
                          > > aivdm message bytes
                          > > >
                          > > >
                          > > > Giuseppe
                          > > >
                          > > > No - don't touch a thing, looks like it was my mistake - I
                          > > didn't
                          > > > realise that latitude and longitude are signed binary
                          numbers.
                          > > >
                          > > > When I take the twos compliment of my longitude value I too
                          get
                          > > 123°
                          > > > 52.66'W
                          > > >
                          > > > My apologies for the confusion. (That's what happens when
                          > you're
                          > > only
                          > > > source of reference is Google Ooops I mean Yahoo)
                          > > >
                          > > > Are you taking you're information from ITU 1371?
                          > > >
                          > > > AJ
                          > > >
                          > > > --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@>
                          wrote:
                          > > > >
                          > > > > I tried to decode with my algorithm your message.
                          Everything
                          > > was
                          > > > fine but the longitude: I got 123°52.66' W, instead of your
                          > 323°
                          > > 30',
                          > > > i.e. 36° 30' W.
                          > > > > As I checked my algorithm in several previous examples,
                          did I
                          > > made
                          > > > a mistake?
                          > > > > Giuseppe
                          > > > > ----- Original Message -----
                          > > > > From: lmukis
                          > > > > To: aismon@yahoogroups.com
                          > > > > Sent: Tuesday, August 26, 2008 5:23 PM
                          > > > > Subject: [aismon] Re: Trying to understand the decoding of
                          > the
                          > > > aivdm message bytes
                          > > > >
                          > > > >
                          > > > > To decode the `data' section of an AIVDM sentence -
                          > > > >
                          > > > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to
                          > > encode
                          > > > the
                          > > > > AIS sentence. Do this by stepping through each character
                          in
                          > > turn
                          > > > and
                          > > > > subtracting 48, if the result is greater than 40, subtract
                          > > > another 8.
                          > > > >
                          > > > > For Example -
                          > > > >
                          > > > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                          > > > >
                          > > > > 8bit 6bit
                          > > > > ------------------------
                          > > > > 0 1 0x31 0x01 000001
                          > > > > 1 4 0x34 0x04 000100
                          > > > > 2 e 0x65 0x2d 101101
                          > > > > 3 G 0x47 0x17 010111
                          > > > > 4 ; 0x3b 0x0b 001011
                          > > > > 5 o 0x6f 0x37 110111
                          > > > > 6 @ 0x40 0x10 010000
                          > > > > 7 0 0x30 0x00 000000
                          > > > > 8 3 0x33 0x03 000011
                          > > > > 9 4 0x34 0x04 000100
                          > > > > 10 o 0x6f 0x37 110111
                          > > > > 11 8 0x38 0x08 001000
                          > > > > 12 s 0x73 0x3b 111011
                          > > > > 13 d 0x64 0x2c 101100
                          > > > > 14 < 0x3c 0x0c 001100
                          > > > > 15 L 0x4c 0x1c 011100
                          > > > > 16 9 0x39 0x09 001001
                          > > > > 17 i 0x69 0x31 110001
                          > > > > 18 : 0x3a 0x0a 001010
                          > > > > 19 a 0x61 0x29 101001
                          > > > > 20 ; 0x3b 0x0b 001011
                          > > > > 21 W 0x57 0x27 100111
                          > > > > 22 F 0x46 0x16 010110
                          > > > > 23 > 0x3e 0x0e 001110
                          > > > > 24 0 0x30 0x00 000000
                          > > > > 25 6 0x36 0x06 000110
                          > > > > 26 2 0x32 0x02 000010
                          > > > > 27 D 0x44 0x14 010100
                          > > > >
                          > > > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get -
                          > > > >
                          > > > > 00000100 01001011 01010111 00101111 01110100 00000000
                          > 00001100
                          > > > > 01001101 11001000 11101110 11000011 00011100 00100111
                          00010010
                          > > > > 10101001 00101110 01110101 10001110 00000000 01100000
                          10010100
                          > > > >
                          > > > > Then just pick out the bit patterns to give you the
                          various
                          > > > values.
                          > > > >
                          > > > > For example -
                          > > > >
                          > > > > Bits 0 - 5 = The Message ID
                          > > > > Bits 8 - 37 = The MMIS Number
                          > > > > .
                          > > > > .
                          > > > > .
                          > > > > .
                          > > > > Bits 62 - 89 = Longitude
                          > > > > Bits 90 - 116 = Latitude
                          > > > > .
                          > > > > .
                          > > > > .
                          > > > > .
                          > > > > etc.
                          > > > >
                          > > > > Using this process the message above decodes to -
                          > > > >
                          > > > > ------------ NMEA AIS Message -------------
                          > > > >
                          > > > > NMEA Message Header : !AIVDM
                          > > > > Number of Sentences : 1
                          > > > > Sentence Number : 1
                          > > > > Sequential Message ID : 0
                          > > > > AIS Channel : A
                          > > > > Checksum : 0x7d
                          > > > > -------------------------------------------
                          > > > > Message Type : 1
                          > > > > Repeat : 0
                          > > > > MMSI : 316001245
                          > > > > Nav. Status : 0000
                          > > > > Rate of Turn : 0.0
                          > > > > SOG : 19.6
                          > > > > Pos. Accuracy : 1
                          > > > > Longitude : 323 degrees 30 minutes
                          > > > > Latitude : 49 degrees 12 minutes
                          > > > > COG : 235.0
                          > > > > True Heading : 235
                          > > > > Message Time : 7 seconds past the minute
                          > > > > Regional App. : 0000
                          > > > > -------------------------------------------
                          > > > >
                          > > > > AJ
                          > > > >
                          > > > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                          > > > > <thormod.nordahl@> wrote:
                          > > > > >
                          > > > > > Lets just take one 8bit char "E"
                          > > > > >
                          > > > > > E ASCII 69
                          > > > > >
                          > > > > > One approach:
                          > > > > > 69 - 48 = 21
                          > > > > > 53 -8 = 13
                          > > > > > 13 = 001101
                          > > > > >
                          > > > > > Second approach
                          > > > > > 6 bit ASCII
                          > > > > >
                          > > > > > E = 5
                          > > > > > 5 = 000101
                          > > > > >
                          > > > > > Third approach
                          > > > > >
                          > > > > > 69 = 01000101
                          > > > > > Remove 2 MSB = 000101 (Same as second approach)
                          > > > > >
                          > > > > > Can anybody enlighten me?
                          > > > > >
                          > > > > > And thanks and cudos to the creator of aismon.
                          > > > > >
                          > > > > > Tom
                          > > > > >
                          > > > >
                          > > >
                          > >
                          >
                        • lmukis
                          Hay Tom I considered doing the very same thing, creating a bit stream using the c++ string type, it makes the value extraction simple but seemed a little
                          Message 12 of 16 , Aug 29, 2008
                          • 0 Attachment
                            Hay Tom

                            I considered doing the very same thing, creating a bit stream using
                            the c++ string type, it makes the value extraction simple but seemed
                            a little excessive, storage wise, when a simple character array would
                            do. At present I have a C++ version of my parser that I'm porting to
                            Java (I want a GUI but I don't do `visual' C++) I'll have to take a
                            look at VB to see what that offers

                            Thanks for the ROT info. I'll be happy to pass on the Msg 24 protocol
                            as soon as I get my hands on 1371-3


                            --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                            <thormod.nordahl@...> wrote:
                            >
                            > Hi AJ
                            > Thanks for the explanation. I'm doing it differently, since I do
                            ues
                            > Basic (VB) I wrote a simple function that converts the data to a
                            > bitstring. VB is excellent at manipulating strings and I use MiD$
                            to
                            > return the spesified number of bits. I then use en other function
                            to
                            > convert that bitstring into its value. More code, but works fine.
                            >
                            > ROT
                            > I get 4 BitStreams 00000000, 10000000,10000001 and 01111111
                            > Representing signed single Byte numbers as I understand it.
                            >
                            > 0 is selfexplanatory (although not in accordance with 1371).
                            > 10000000 Hex 80 -127 Default, not available
                            > 10000001 -127 turning left faster than 720 deg/min
                            > 01111111 127 turning right faster than 720 deg/min
                            >
                            > But,the meaning of:
                            > Coded by ROTAIS=4.733 SQRT(ROTINDICATED) degrees/min
                            > ROTINDICATED is the Rate of Turn (720 degrees per minute), as
                            > indicated by an external sensor.
                            > eludes me.
                            >
                            > Tom
                            >
                            > Please, when you get 1371-3, I'd love to have the protocol for Msg
                            ID
                            > 24.
                            >
                            > --- In aismon@yahoogroups.com, "lmukis" <lmukis@> wrote:
                            > >
                            > > Hi Tom
                            > >
                            > > I wanted to use an unsigned character array to handle the data
                            and
                            > > decided to pack the 6 bit bytes into the array. I then have a
                            > simple
                            > > routine to extract the required bits given the first and last bit
                            > > positions (i.e. 89-115 for Latitude) I needed to keep the code
                            > basic
                            > > (NOT B.A.S.I.C!) as I suspect I may have to port this to an
                            > embedded
                            > > ADA environment.
                            > > I'm sure others have better methods of doing the bit manipulation
                            > and
                            > > I always welcome suggestions.
                            > >
                            > > One area I'm currently stuck on is the rate of turn calculation
                            > (b42-
                            > > b49 deg/min) If anyone can enlighten me I'd be most appreciative.
                            > >
                            > > AJ
                            > >
                            > >
                            > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                            > > <thormod.nordahl@> wrote:
                            > > >
                            > > > Interesting, You too have found the error in the BosunMates
                            > parsing
                            > > > example.
                            > > >
                            > > > But I dont understant the need to Quote: Overlay your 6 bit
                            bytes
                            > > > onto 8 bit bytes and you'll get –UnQuote.
                            > > > At this point we are dealing with a bitstream and I dont see
                            the
                            > > > purpose of bunching them into bytes.
                            > > >
                            > > > Tom
                            > > >
                            > > > --- In aismon@yahoogroups.com, "lmukis" <lmukis@> wrote:
                            > > > >
                            > > > > To decode the `data' section of an AIVDM sentence –
                            > > > >
                            > > > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to
                            > encode
                            > > > the
                            > > > > AIS sentence. Do this by stepping through each character in
                            > turn
                            > > > and
                            > > > > subtracting 48, if the result is greater than 40, subtract
                            > > another
                            > > > 8.
                            > > > >
                            > > > > For Example –
                            > > > >
                            > > > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                            > > > >
                            > > > > 8bit 6bit
                            > > > > ------------------------
                            > > > > 0 1 0x31 0x01 000001
                            > > > > 1 4 0x34 0x04 000100
                            > > > > 2 e 0x65 0x2d 101101
                            > > > > 3 G 0x47 0x17 010111
                            > > > > 4 ; 0x3b 0x0b 001011
                            > > > > 5 o 0x6f 0x37 110111
                            > > > > 6 @ 0x40 0x10 010000
                            > > > > 7 0 0x30 0x00 000000
                            > > > > 8 3 0x33 0x03 000011
                            > > > > 9 4 0x34 0x04 000100
                            > > > > 10 o 0x6f 0x37 110111
                            > > > > 11 8 0x38 0x08 001000
                            > > > > 12 s 0x73 0x3b 111011
                            > > > > 13 d 0x64 0x2c 101100
                            > > > > 14 < 0x3c 0x0c 001100
                            > > > > 15 L 0x4c 0x1c 011100
                            > > > > 16 9 0x39 0x09 001001
                            > > > > 17 i 0x69 0x31 110001
                            > > > > 18 : 0x3a 0x0a 001010
                            > > > > 19 a 0x61 0x29 101001
                            > > > > 20 ; 0x3b 0x0b 001011
                            > > > > 21 W 0x57 0x27 100111
                            > > > > 22 F 0x46 0x16 010110
                            > > > > 23 > 0x3e 0x0e 001110
                            > > > > 24 0 0x30 0x00 000000
                            > > > > 25 6 0x36 0x06 000110
                            > > > > 26 2 0x32 0x02 000010
                            > > > > 27 D 0x44 0x14 010100
                            > > > >
                            > > > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get –
                            > > > >
                            > > > > 00000100 01001011 01010111 00101111 01110100 00000000
                            00001100
                            > > > > 01001101 11001000 11101110 11000011 00011100 00100111 00010010
                            > > > > 10101001 00101110 01110101 10001110 00000000 01100000 10010100
                            > > > >
                            > > > > Then just pick out the bit patterns to give you the various
                            > > values.
                            > > > >
                            > > > > For example -
                            > > > >
                            > > > > Bits 0 – 5 = The Message ID
                            > > > > Bits 8 – 37 = The MMIS Number
                            > > > > .
                            > > > > .
                            > > > > .
                            > > > > .
                            > > > > Bits 62 – 89 = Longitude
                            > > > > Bits 90 – 116 = Latitude
                            > > > > .
                            > > > > .
                            > > > > .
                            > > > > .
                            > > > > etc.
                            > > > >
                            > > > > Using this process the message above decodes to -
                            > > > >
                            > > > > ------------ NMEA AIS Message -------------
                            > > > >
                            > > > > NMEA Message Header : !AIVDM
                            > > > > Number of Sentences : 1
                            > > > > Sentence Number : 1
                            > > > > Sequential Message ID : 0
                            > > > > AIS Channel : A
                            > > > > Checksum : 0x7d
                            > > > > -------------------------------------------
                            > > > > Message Type : 1
                            > > > > Repeat : 0
                            > > > > MMSI : 316001245
                            > > > > Nav. Status : 0000
                            > > > > Rate of Turn : 0.0
                            > > > > SOG : 19.6
                            > > > > Pos. Accuracy : 1
                            > > > > Longitude : 323 degrees 30 minutes
                            > > > > Latitude : 49 degrees 12 minutes
                            > > > > COG : 235.0
                            > > > > True Heading : 235
                            > > > > Message Time : 7 seconds past the minute
                            > > > > Regional App. : 0000
                            > > > > -------------------------------------------
                            > > > >
                            > > > > AJ
                            > > > >
                            > > > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                            > > > > <thormod.nordahl@> wrote:
                            > > > > >
                            > > > > > Lets just take one 8bit char "E"
                            > > > > >
                            > > > > > E ASCII 69
                            > > > > >
                            > > > > > One approach:
                            > > > > > 69 - 48 = 21
                            > > > > > 53 -8 = 13
                            > > > > > 13 = 001101
                            > > > > >
                            > > > > > Second approach
                            > > > > > 6 bit ASCII
                            > > > > >
                            > > > > > E = 5
                            > > > > > 5 = 000101
                            > > > > >
                            > > > > > Third approach
                            > > > > >
                            > > > > > 69 = 01000101
                            > > > > > Remove 2 MSB = 000101 (Same as second approach)
                            > > > > >
                            > > > > > Can anybody enlighten me?
                            > > > > >
                            > > > > > And thanks and cudos to the creator of aismon.
                            > > > > >
                            > > > > > Tom
                            > > > > >
                            > > > >
                            > > >
                            > >
                            >
                          • lmukis
                            Thanks, I ll add it to the list. Have you considered representing the AIS Message types in XML? ... rember ... link ... of ... subtract
                            Message 13 of 16 , Aug 29, 2008
                            • 0 Attachment
                              Thanks, I'll add it to the list.

                              Have you considered representing the AIS Message types in XML?

                              --- In aismon@yahoogroups.com, "JensNL" <jensnl@...> wrote:
                              >
                              > If you need the Class B stuff you will need 62287
                              > I can't find it but about 2 yers ago I downloaded a draft version
                              >
                              > For the text string (6 bit letters) I made function that take a
                              > format string That look like this 6,31,-27,-28, .... (I don't
                              rember
                              > the numbers) and the output is a linked list where first element is
                              > 6 bit unsigned then 31 bit unsigned, then 27bit signed etc. then
                              > it's easy to add new message types.
                              >
                              >
                              > --- In aismon@yahoogroups.com, "lmukis" <lmukis@> wrote:
                              > >
                              > > Thanks for the info. I'll try the link as soon as I get home.
                              > >
                              > > Looks like I've managed to talk my company into purchasing IEC
                              > 61993-
                              > > 2, ITU M1371-3 and NMEA 0183 v 3
                              > >
                              > > If anyone can suggest any other documents that might be useful
                              > please
                              > > let me know. I'd like to get the order in while management is
                              > still
                              > > in a good mood!
                              > >
                              > > AJ
                              > >
                              > >
                              > > --- In aismon@yahoogroups.com, "JensNL" <jensnl@> wrote:
                              > > >
                              > > > I don't know if it's a mistake that you can download this file
                              > > > It's old but have all the Class A info you need.
                              > > > I hope the link works I just googled 61993 and it was the 3.
                              link
                              > > >
                              > > > http://www.tdcom.fr/support/index.php?dir=Sailor%2FAIS-1%
                              > > 2FDocuments%
                              > > > 2FIEC+doc%2F&download=iec61993-2%7Bed1.0%7Den.pdf
                              > > >
                              > > > --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@> wrote:
                              > > > >
                              > > > > Yes, I read ITU 1371_1
                              > > > > Giuseppe
                              > > > > ----- Original Message -----
                              > > > > From: lmukis
                              > > > > To: aismon@yahoogroups.com
                              > > > > Sent: Wednesday, August 27, 2008 4:35 PM
                              > > > > Subject: [aismon] Re: Trying to understand the decoding of
                              > the
                              > > > aivdm message bytes
                              > > > >
                              > > > >
                              > > > > Giuseppe
                              > > > >
                              > > > > No - don't touch a thing, looks like it was my mistake - I
                              > > > didn't
                              > > > > realise that latitude and longitude are signed binary
                              > numbers.
                              > > > >
                              > > > > When I take the twos compliment of my longitude value I too
                              > get
                              > > > 123°
                              > > > > 52.66'W
                              > > > >
                              > > > > My apologies for the confusion. (That's what happens when
                              > > you're
                              > > > only
                              > > > > source of reference is Google Ooops I mean Yahoo)
                              > > > >
                              > > > > Are you taking you're information from ITU 1371?
                              > > > >
                              > > > > AJ
                              > > > >
                              > > > > --- In aismon@yahoogroups.com, "Giuseppe Menga" <menga@>
                              > wrote:
                              > > > > >
                              > > > > > I tried to decode with my algorithm your message.
                              > Everything
                              > > > was
                              > > > > fine but the longitude: I got 123°52.66' W, instead of your
                              > > 323°
                              > > > 30',
                              > > > > i.e. 36° 30' W.
                              > > > > > As I checked my algorithm in several previous examples,
                              > did I
                              > > > made
                              > > > > a mistake?
                              > > > > > Giuseppe
                              > > > > > ----- Original Message -----
                              > > > > > From: lmukis
                              > > > > > To: aismon@yahoogroups.com
                              > > > > > Sent: Tuesday, August 26, 2008 5:23 PM
                              > > > > > Subject: [aismon] Re: Trying to understand the decoding
                              of
                              > > the
                              > > > > aivdm message bytes
                              > > > > >
                              > > > > >
                              > > > > > To decode the `data' section of an AIVDM sentence -
                              > > > > >
                              > > > > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to
                              > > > encode
                              > > > > the
                              > > > > > AIS sentence. Do this by stepping through each character
                              > in
                              > > > turn
                              > > > > and
                              > > > > > subtracting 48, if the result is greater than 40,
                              subtract
                              > > > > another 8.
                              > > > > >
                              > > > > > For Example -
                              > > > > >
                              > > > > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                              > > > > >
                              > > > > > 8bit 6bit
                              > > > > > ------------------------
                              > > > > > 0 1 0x31 0x01 000001
                              > > > > > 1 4 0x34 0x04 000100
                              > > > > > 2 e 0x65 0x2d 101101
                              > > > > > 3 G 0x47 0x17 010111
                              > > > > > 4 ; 0x3b 0x0b 001011
                              > > > > > 5 o 0x6f 0x37 110111
                              > > > > > 6 @ 0x40 0x10 010000
                              > > > > > 7 0 0x30 0x00 000000
                              > > > > > 8 3 0x33 0x03 000011
                              > > > > > 9 4 0x34 0x04 000100
                              > > > > > 10 o 0x6f 0x37 110111
                              > > > > > 11 8 0x38 0x08 001000
                              > > > > > 12 s 0x73 0x3b 111011
                              > > > > > 13 d 0x64 0x2c 101100
                              > > > > > 14 < 0x3c 0x0c 001100
                              > > > > > 15 L 0x4c 0x1c 011100
                              > > > > > 16 9 0x39 0x09 001001
                              > > > > > 17 i 0x69 0x31 110001
                              > > > > > 18 : 0x3a 0x0a 001010
                              > > > > > 19 a 0x61 0x29 101001
                              > > > > > 20 ; 0x3b 0x0b 001011
                              > > > > > 21 W 0x57 0x27 100111
                              > > > > > 22 F 0x46 0x16 010110
                              > > > > > 23 > 0x3e 0x0e 001110
                              > > > > > 24 0 0x30 0x00 000000
                              > > > > > 25 6 0x36 0x06 000110
                              > > > > > 26 2 0x32 0x02 000010
                              > > > > > 27 D 0x44 0x14 010100
                              > > > > >
                              > > > > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get -
                              > > > > >
                              > > > > > 00000100 01001011 01010111 00101111 01110100 00000000
                              > > 00001100
                              > > > > > 01001101 11001000 11101110 11000011 00011100 00100111
                              > 00010010
                              > > > > > 10101001 00101110 01110101 10001110 00000000 01100000
                              > 10010100
                              > > > > >
                              > > > > > Then just pick out the bit patterns to give you the
                              > various
                              > > > > values.
                              > > > > >
                              > > > > > For example -
                              > > > > >
                              > > > > > Bits 0 - 5 = The Message ID
                              > > > > > Bits 8 - 37 = The MMIS Number
                              > > > > > .
                              > > > > > .
                              > > > > > .
                              > > > > > .
                              > > > > > Bits 62 - 89 = Longitude
                              > > > > > Bits 90 - 116 = Latitude
                              > > > > > .
                              > > > > > .
                              > > > > > .
                              > > > > > .
                              > > > > > etc.
                              > > > > >
                              > > > > > Using this process the message above decodes to -
                              > > > > >
                              > > > > > ------------ NMEA AIS Message -------------
                              > > > > >
                              > > > > > NMEA Message Header : !AIVDM
                              > > > > > Number of Sentences : 1
                              > > > > > Sentence Number : 1
                              > > > > > Sequential Message ID : 0
                              > > > > > AIS Channel : A
                              > > > > > Checksum : 0x7d
                              > > > > > -------------------------------------------
                              > > > > > Message Type : 1
                              > > > > > Repeat : 0
                              > > > > > MMSI : 316001245
                              > > > > > Nav. Status : 0000
                              > > > > > Rate of Turn : 0.0
                              > > > > > SOG : 19.6
                              > > > > > Pos. Accuracy : 1
                              > > > > > Longitude : 323 degrees 30 minutes
                              > > > > > Latitude : 49 degrees 12 minutes
                              > > > > > COG : 235.0
                              > > > > > True Heading : 235
                              > > > > > Message Time : 7 seconds past the minute
                              > > > > > Regional App. : 0000
                              > > > > > -------------------------------------------
                              > > > > >
                              > > > > > AJ
                              > > > > >
                              > > > > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                              > > > > > <thormod.nordahl@> wrote:
                              > > > > > >
                              > > > > > > Lets just take one 8bit char "E"
                              > > > > > >
                              > > > > > > E ASCII 69
                              > > > > > >
                              > > > > > > One approach:
                              > > > > > > 69 - 48 = 21
                              > > > > > > 53 -8 = 13
                              > > > > > > 13 = 001101
                              > > > > > >
                              > > > > > > Second approach
                              > > > > > > 6 bit ASCII
                              > > > > > >
                              > > > > > > E = 5
                              > > > > > > 5 = 000101
                              > > > > > >
                              > > > > > > Third approach
                              > > > > > >
                              > > > > > > 69 = 01000101
                              > > > > > > Remove 2 MSB = 000101 (Same as second approach)
                              > > > > > >
                              > > > > > > Can anybody enlighten me?
                              > > > > > >
                              > > > > > > And thanks and cudos to the creator of aismon.
                              > > > > > >
                              > > > > > > Tom
                              > > > > > >
                              > > > > >
                              > > > >
                              > > >
                              > >
                              >
                            • Thormod (Tom) Nordahl
                              Thanks for the offer, but may I keep it for a rainy day ? I found Id 24 on AisParser.com http://aisparser.com/sdk/structaismsg__24.html Actually - I didn t.
                              Message 14 of 16 , Sep 11, 2008
                              • 0 Attachment
                                Thanks for the offer, but may I keep it "for a rainy day"?
                                I found Id 24 on AisParser.com
                                http://aisparser.com/sdk/structaismsg__24.html
                                Actually - I didn't. Somebody pointed it out to me.

                                Tom
                                --- In aismon@yahoogroups.com, "lmukis" <lmukis@...> wrote:
                                >
                                > Hay Tom
                                >
                                > I considered doing the very same thing, creating a bit stream using
                                > the c++ string type, it makes the value extraction simple but
                                seemed
                                > a little excessive, storage wise, when a simple character array
                                would
                                > do. At present I have a C++ version of my parser that I'm porting
                                to
                                > Java (I want a GUI but I don't do `visual' C++) I'll have to take a
                                > look at VB to see what that offers
                                >
                                > Thanks for the ROT info. I'll be happy to pass on the Msg 24
                                protocol
                                > as soon as I get my hands on 1371-3
                                >
                                >
                                > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                                > <thormod.nordahl@> wrote:
                                > >
                                > > Hi AJ
                                > > Thanks for the explanation. I'm doing it differently, since I do
                                > ues
                                > > Basic (VB) I wrote a simple function that converts the data to a
                                > > bitstring. VB is excellent at manipulating strings and I use MiD$
                                > to
                                > > return the spesified number of bits. I then use en other function
                                > to
                                > > convert that bitstring into its value. More code, but works fine.
                                > >
                                > > ROT
                                > > I get 4 BitStreams 00000000, 10000000,10000001 and 01111111
                                > > Representing signed single Byte numbers as I understand it.
                                > >
                                > > 0 is selfexplanatory (although not in accordance with 1371).
                                > > 10000000 Hex 80 -127 Default, not available
                                > > 10000001 -127 turning left faster than 720 deg/min
                                > > 01111111 127 turning right faster than 720 deg/min
                                > >
                                > > But,the meaning of:
                                > > Coded by ROTAIS=4.733 SQRT(ROTINDICATED) degrees/min
                                > > ROTINDICATED is the Rate of Turn (720 degrees per minute), as
                                > > indicated by an external sensor.
                                > > eludes me.
                                > >
                                > > Tom
                                > >
                                > > Please, when you get 1371-3, I'd love to have the protocol for
                                Msg
                                > ID
                                > > 24.
                                > >
                                > > --- In aismon@yahoogroups.com, "lmukis" <lmukis@> wrote:
                                > > >
                                > > > Hi Tom
                                > > >
                                > > > I wanted to use an unsigned character array to handle the data
                                > and
                                > > > decided to pack the 6 bit bytes into the array. I then have a
                                > > simple
                                > > > routine to extract the required bits given the first and last
                                bit
                                > > > positions (i.e. 89-115 for Latitude) I needed to keep the code
                                > > basic
                                > > > (NOT B.A.S.I.C!) as I suspect I may have to port this to an
                                > > embedded
                                > > > ADA environment.
                                > > > I'm sure others have better methods of doing the bit
                                manipulation
                                > > and
                                > > > I always welcome suggestions.
                                > > >
                                > > > One area I'm currently stuck on is the rate of turn calculation
                                > > (b42-
                                > > > b49 deg/min) If anyone can enlighten me I'd be most
                                appreciative.
                                > > >
                                > > > AJ
                                > > >
                                > > >
                                > > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                                > > > <thormod.nordahl@> wrote:
                                > > > >
                                > > > > Interesting, You too have found the error in the BosunMates
                                > > parsing
                                > > > > example.
                                > > > >
                                > > > > But I dont understant the need to Quote: Overlay your 6 bit
                                > bytes
                                > > > > onto 8 bit bytes and you'll get –UnQuote.
                                > > > > At this point we are dealing with a bitstream and I dont see
                                > the
                                > > > > purpose of bunching them into bytes.
                                > > > >
                                > > > > Tom
                                > > > >
                                > > > > --- In aismon@yahoogroups.com, "lmukis" <lmukis@> wrote:
                                > > > > >
                                > > > > > To decode the `data' section of an AIVDM sentence –
                                > > > > >
                                > > > > > Convert the 8 bit ASCII `data' to the 6 bit ASCII used to
                                > > encode
                                > > > > the
                                > > > > > AIS sentence. Do this by stepping through each character in
                                > > turn
                                > > > > and
                                > > > > > subtracting 48, if the result is greater than 40, subtract
                                > > > another
                                > > > > 8.
                                > > > > >
                                > > > > > For Example –
                                > > > > >
                                > > > > > !AIVDM,1,1,,A,14eG;o@034o8sd<L9i:a;WF>062D,0*7D
                                > > > > >
                                > > > > > 8bit 6bit
                                > > > > > ------------------------
                                > > > > > 0 1 0x31 0x01 000001
                                > > > > > 1 4 0x34 0x04 000100
                                > > > > > 2 e 0x65 0x2d 101101
                                > > > > > 3 G 0x47 0x17 010111
                                > > > > > 4 ; 0x3b 0x0b 001011
                                > > > > > 5 o 0x6f 0x37 110111
                                > > > > > 6 @ 0x40 0x10 010000
                                > > > > > 7 0 0x30 0x00 000000
                                > > > > > 8 3 0x33 0x03 000011
                                > > > > > 9 4 0x34 0x04 000100
                                > > > > > 10 o 0x6f 0x37 110111
                                > > > > > 11 8 0x38 0x08 001000
                                > > > > > 12 s 0x73 0x3b 111011
                                > > > > > 13 d 0x64 0x2c 101100
                                > > > > > 14 < 0x3c 0x0c 001100
                                > > > > > 15 L 0x4c 0x1c 011100
                                > > > > > 16 9 0x39 0x09 001001
                                > > > > > 17 i 0x69 0x31 110001
                                > > > > > 18 : 0x3a 0x0a 001010
                                > > > > > 19 a 0x61 0x29 101001
                                > > > > > 20 ; 0x3b 0x0b 001011
                                > > > > > 21 W 0x57 0x27 100111
                                > > > > > 22 F 0x46 0x16 010110
                                > > > > > 23 > 0x3e 0x0e 001110
                                > > > > > 24 0 0x30 0x00 000000
                                > > > > > 25 6 0x36 0x06 000110
                                > > > > > 26 2 0x32 0x02 000010
                                > > > > > 27 D 0x44 0x14 010100
                                > > > > >
                                > > > > > Overlay your 6 bit bytes onto 8 bit bytes and you'll get –
                                > > > > >
                                > > > > > 00000100 01001011 01010111 00101111 01110100 00000000
                                > 00001100
                                > > > > > 01001101 11001000 11101110 11000011 00011100 00100111
                                00010010
                                > > > > > 10101001 00101110 01110101 10001110 00000000 01100000
                                10010100
                                > > > > >
                                > > > > > Then just pick out the bit patterns to give you the various
                                > > > values.
                                > > > > >
                                > > > > > For example -
                                > > > > >
                                > > > > > Bits 0 – 5 = The Message ID
                                > > > > > Bits 8 – 37 = The MMIS Number
                                > > > > > .
                                > > > > > .
                                > > > > > .
                                > > > > > .
                                > > > > > Bits 62 – 89 = Longitude
                                > > > > > Bits 90 – 116 = Latitude
                                > > > > > .
                                > > > > > .
                                > > > > > .
                                > > > > > .
                                > > > > > etc.
                                > > > > >
                                > > > > > Using this process the message above decodes to -
                                > > > > >
                                > > > > > ------------ NMEA AIS Message -------------
                                > > > > >
                                > > > > > NMEA Message Header : !AIVDM
                                > > > > > Number of Sentences : 1
                                > > > > > Sentence Number : 1
                                > > > > > Sequential Message ID : 0
                                > > > > > AIS Channel : A
                                > > > > > Checksum : 0x7d
                                > > > > > -------------------------------------------
                                > > > > > Message Type : 1
                                > > > > > Repeat : 0
                                > > > > > MMSI : 316001245
                                > > > > > Nav. Status : 0000
                                > > > > > Rate of Turn : 0.0
                                > > > > > SOG : 19.6
                                > > > > > Pos. Accuracy : 1
                                > > > > > Longitude : 323 degrees 30 minutes
                                > > > > > Latitude : 49 degrees 12 minutes
                                > > > > > COG : 235.0
                                > > > > > True Heading : 235
                                > > > > > Message Time : 7 seconds past the minute
                                > > > > > Regional App. : 0000
                                > > > > > -------------------------------------------
                                > > > > >
                                > > > > > AJ
                                > > > > >
                                > > > > > --- In aismon@yahoogroups.com, "Thormod (Tom) Nordahl"
                                > > > > > <thormod.nordahl@> wrote:
                                > > > > > >
                                > > > > > > Lets just take one 8bit char "E"
                                > > > > > >
                                > > > > > > E ASCII 69
                                > > > > > >
                                > > > > > > One approach:
                                > > > > > > 69 - 48 = 21
                                > > > > > > 53 -8 = 13
                                > > > > > > 13 = 001101
                                > > > > > >
                                > > > > > > Second approach
                                > > > > > > 6 bit ASCII
                                > > > > > >
                                > > > > > > E = 5
                                > > > > > > 5 = 000101
                                > > > > > >
                                > > > > > > Third approach
                                > > > > > >
                                > > > > > > 69 = 01000101
                                > > > > > > Remove 2 MSB = 000101 (Same as second approach)
                                > > > > > >
                                > > > > > > Can anybody enlighten me?
                                > > > > > >
                                > > > > > > And thanks and cudos to the creator of aismon.
                                > > > > > >
                                > > > > > > Tom
                                > > > > > >
                                > > > > >
                                > > > >
                                > > >
                                > >
                                >
                              Your message has been successfully submitted and would be delivered to recipients shortly.