Re: Re: how to read AIS data from encapsulated NMEA VDO sentence
- From: Kenny <ReplyToMessageToContact@xxxxxxxx>
- Date: Fri, 14 Jul 2006 00:15:19 GMT
"Paul" wrote:
<coderpunk@xxxxxxxxx> wrote in message
news:1150254823.702754.271150@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
make sense.
Paul wrote:
<nickw473@xxxxxxxxxxx> wrote in message
news:1149652247.992435.169280@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Actually, I re-read what I posted and it didn't really
bit
1. Start with the array of ascii characters
2. Convert to the 6 bit binary value.
3. Convert this byte array to a 6 bit bitstream.
4. Then just pull out the bits yuo want using the various
to work inoperators. I tried to use a bit-field, but it didn't seem
(call signWindows.
As I said, it all works until I get to character arrays
type 5 (I'm onlyetc)
Here is a portion of the code i wrote to handle message
attention to myhandling the "Ship Static and Voyage Related Data
" variant for now). My comments follow the code. Pay
intermediate stepfunction H6StrToAsc, and how I manipulate the ascii.
I'll assume Paul's code is right :) He's skipping the
which may be where the confusion lies. There are severallayers of
things happening here.representation
0. Bits over the air: 9600bps GMSK data.
1. Demodulated bitstream, eg. 168 bits for a message 1.
2. Actual message content like Message ID, MMSI, Ship Name.
3. Serial output of bitstream using 6-bit encoding.
The data you see in the VDM sentence is a 6-bit encoded
of the raw bitstream, first bit on the left, last bit on theright (as
God intended things!).did, or
To get the ship name you need to either skip ahead like Paul
convert the 6-bit back to its bitstream. Then you grab thebits in the
name position and apply the m.1371 ASCII encoding rules tothose bits.
BUT! That conversion is DIFFERENT from the 6-bitencode/decode. That is
probably what was tripping you up.
.cp
I hereby give you a full money-back guarantee that my code is
correct. At
least it seems to usually kind of work. The only trouble I've
seen is that
I get a spurious (or incorrectly encoded?) rate-of-turn value
sometimes,
positive or negative full-scale, if I recall correctly. I
haven't posted
that code, though.
As for the intermediate step of converting to a serial
bitstream, there is
certainly nothing wrong with doing so, and it may indeed
simplify some
operations. I found that with the lack of easy bit-field
operators in
Visual Basic, it was just as simple to use the VDM message
character string
directly. All the data is there, and I found no good reason
to do an
additional conversion. If I were dong this in c, I probably
would have gone
to the bitstream. And yes, the ASCII conversion is different
than the 6-bit
encode/decode, which is why I directed the original poster to
the H6StrToAsc
function in my code.
I was about to ask for help with my ROT problem, and in
researching my
sources I just found a later spec than I had been using which
shows that
+/-127 values have been taken over to indicate a
heading-derived ROT, rather
than a turn-indicator-derived ROT (which uses the values
between -126 and
+126). Problem solved! Now, I guarantee double your money
back!
Regards,
Paul
Dear
I am development any software of navigation in Peru for present data
AIS in Chart electronic. I have the frame AIVDM decode, the ais SR162
only receive frame !AIVDM wich have info the MMSI, position, course,
speed, others.. but i want get the name of ship, and more data related
of voyage,... how program the receptor for get the name of ship ???
and how this encode, is equal to AIVDM (6 bits)..? Thanks..
Regards
.
- Follow-Ups:
- Re: how to read AIS data from encapsulated NMEA VDO sentence
- From: coderpunk
- Re: how to read AIS data from encapsulated NMEA VDO sentence
- Prev by Date: Re: hooking up laptop navigation program to Raymarine tillerpilot
- Next by Date: Re: Can an alternator be to big?
- Previous by thread: Can an alternator be to big?
- Next by thread: Re: how to read AIS data from encapsulated NMEA VDO sentence
- Index(es):
Relevant Pages
|