Decoding Sequence For Pd0 Data; Decoding Sequence Example - Teledyne WORKHORSE Operation Manual

Horizontal h-adcp
Hide thumbs Also See for WORKHORSE:
Table of Contents

Advertisement

May 2015

Decoding Sequence for PD0 Data

To decode PD0 data:
1. Locate the header data by locating the header ID number (in the case of PD0 profile data that will
be 7F7F).
2. Confirm that you have the correct header ID by:
a. Locating the total number of bytes (located in the header data) in the ensemble. This will be
your offset to the next ensemble.
b. Calculate the checksum of total number of bytes in the ensemble excluding the checksum. The
checksum is calculated by adding the value of each byte. The 2-byte least significant digits that
you calculate will be the checksum.
c. Read the 2-byte checksum word at the end of the ensemble, located by using the checksum
offset in the header (determined in step 2-a) and compare this checksum word to the value
calculated in step 2-b.
d. If the checksums match then you have a valid ensemble. If the checksums do not match then
you do not have a valid ensemble and you need to go back to step 1 and search for the next
header ID number occurrence.
3. Locate the number of data types (located in the header data).
4. Locate the offset to each data type (located in the header data).
5. Locate the data ID type you wish to decode by using the offset to each data type and confirm the
data ID number at that offset matches the ID type you are looking for.
6. Once the proper ID type has been located, use this manual to understand what each byte repre-
sents in that particular data type.

Decoding Sequence Example

All the available binary output data formats respect the same "header/leader ID + offset to data type"
structure that eliminates the need for byte-counting. As an example, let's assume you selected PD5 output
format and you need to decode the Roll data from each ensemble.
Based on the documentation,
Thus, let's assume you created code that read the serial data coming from the instrument and scan for this
ID. Once 7Dh is detected in the raw data, based on the PD5 output data format tables, you simply need to
jump down 50 bytes to directly get to the roll data coded on bytes 51 and 52 as a 2s-complement signed
variable. This "jump" can be done by adding the offset to a pointer address pointing to the leader ID.
As mentioned above, the Roll data is a 2s-complement signed variable. Let's assume the roll data that you
want to decode is ea ff in the binary raw data. Since the PD5 format is LSB (Byte 51) MSB (Byte 52), it
should read Roll (hexa) = ff ea.
Let's transform both hexadecimal bytes into 2 binary bytes:
Page 240
EAR-Controlled Technology Subject to Restrictions Contained on the Cover Page.
PD5
data type is
PD4
+ PD5 data with the Leader ID of PD4 = 7Dh.
WorkHorse H-ADCP Operation Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents