Here explained that the field 4 is a sequential message ID for multi-sentence messages. What does it means? What is the difference between field 4 and field 3?
From the website:
Field 2 (1 in this example) is the count of fragments in the currently accumulating message. The payload size of each sentence is limited by NMEA 0183’s 82-character maximum, so it is sometimes required to split a payload over several fragment sentences.
Field 3 (1 in this example) is the fragment number of this sentence. It will be one-based. A sentence with a fragment count of 1 and a fragment number of 1 is complete in itself.
Field 4 (empty in this example) is a sequential message ID for multi-sentence messages.
Consider a message sent using 2 fragments:
2
, the number of fragments.1
for the first fragment, and 2
for the second0
and 9
, but will be common for both messages. This number is incremented for each new multi-fragment message sent by a vessel. It allows the decoding program to match together fragments that belong to the same message.Here's one other example:
!AIVDM,2,1,8,A,56;OaD02B8EL990b221`P4v1T4pN0HDpN2222216HHN>B6U30A2hCDhD`888,0*4D
!AIVDM,2,2,8,A,88888888880,2*2C
The message has 2
parts (from field #2), we can see fragments 1
and 2
(from field #3), and the message_id for both fragments of this message is 8
(from field #4).
From the same vessels, I had previously received message ID 7
, and right before this message ID 6
, etc.