| EM datagrams on *.kmall format Reg. nr. 410224 rev I

KM Binary sensor input format

#### Revision history

May 11, 2016. First issue.
July 02, 2018. The definition of the timestamp is updated.

### KM Binary sensor data, version 1, length 132 bytes

Data field | Content | Format | # of bytes
--- | --- | --- | ---
Start ID | #KMB | char | 4U
Datagram length | 132 | uint16 | 2U
Datagram version | 1 | uint16 | 2U
UTC seconds | s | uint32 | 4U
UTC nanoseconds | ns | uint32 | 4U
Status word | See 1) | uint32 | 4U
Latitude | deg | double | 8F
Longitude | deg | double | 8F
Ellipsoid height | m | float | 4F
Roll | deg | float | 4F
Pitch | deg | float | 4F
Heading | deg | float | 4F
Heave | m | float | 4F
Roll rate | deg/s | float | 4F
Pitch rate | deg/s | float | 4F
Yaw rate | deg/s | float | 4F
North velocity | m/s | float | 4F
East velocity | m/s | float | 4F
Down velocity | m/s | float | 4F
Latitude error | m | float | 4F
Longitude error | m | float | 4F
Height error | m | float | 4F
Roll error | deg | float | 4F
Pitch error | deg | float | 4F
Heading error | deg | float | 4F
Heave error | m | float | 4F
North acceleration | m/s2 | float | 4F
East acceleration | m/s2 | float | 4F
Down acceleration | m/s2 | float | 4F
Delayed heave: | - | - | -
UTC seconds | s | uint32 | 4U
UTC nanoseconds | ns | uint32 | 4U
Delayed heave | m | float | 4F

For calculation of the doppler effect at the transducer locations (needed in FM chirp mode), the following data is mandatory: Roll, pitch, heave, heading, 3 axis rates and velocities. The update rate should be minimum 100 Hz. Delayed heave is strongly recommended (if this improves the heave quality). Note that the delayed heave is based on the same reference point as regular heave.

### Definitions

Data field | Description
--- | ---
Data format | Little endian (the least significant byte is transmitted first). Float is according to IEEE - 754.
Dgm length | The total number of bytes in the datagram.
Dgm version | The version is incremented if the datagram format is changed.
Timestamp format | Epoch 1970-01-01 UTC time
Position and height | At user defined sensor reference point. Position in decimal degrees.
Latitude | Negative on Southern hemisphere.
Longitude | Negative on Western hemisphere.
Height | Positive above ellipsoid.
Positive roll | Port side up.
Positive pitch | Bow up.
Positive heave | Downwards, at user defined sensor reference point.
Heading | True North.
Error fields | Sensor data quality: RMS, -1 = not implemented

### 1) Status word

One bit per status info, 1= active

Bit # | Invalid data:
--- | ---
0 | Horizontal position and velocity
1 | Roll and pitch
2 | Heading
3 | Heave and vertical velocity
4 | Acceleration
5 | Delayed heave

Bit # | Reduced performance:
--- | ---
16 | Horizontal position and velocity
17 | Roll and pitch
18 | Heading
19 | Heave and vertical velocity
20 | Acceleration
21 | Delayed heave