Skip to content

data format

Matthias Leubin edited this page Dec 9, 2016 · 96 revisions

RocketLogger Data (RLD) Format Specification

The sampled data can be stored either in CSV or in binary RLD format, which is explained below.

Overview

A RLD file consists of a file header and a data structure. The header contains a constant size lead-in, a comment and a list of channel structs, describing all sampled channels. The data part contains a list of data blocks. All blocks are aligned to 32-bit and the data ist saved in Little-Endian.

The following picture shows an overview of the file structure. Red blocks define data, whereras all other colors are only used to show the logic structure.

Data Format

File Header

Lead-In

The file header lead in contains general measurement information and has a fixed size.

Offset Size (byte) Field Content
0x00 4 Magic Number %RLD ( = 0x444C5225) magic number (unsigned integer)
0x04 2 File Version Current file version number (unsigned integer)
0x06 2 Header Length Total header length in bytes (unsigned integer)
0x08 4 Data Block Size Data block size in samples (unsigned integer)
0x0C 4 Data Block Count Number of data blocks (unsigned integer), last block may not be full
0x10 8 Sample Count Total number of samples taken (unsigned integer)
0x18 2 Sampling Rate Sampling rate in SPS (unsigned integer)
0x1A 6 x 1 MAC Address MAC address as device identifier, stored in Big-Endian (unsigned integer)
0x20 8 Start Time Seconds Start time seconds in UNIX UTC time (unsigned integer)
0x28 8 Start Time Nanoseconds Start time nanoseconds (unsigned integer)
0x30 4 Comment Length Length of header comment in bytes (unsigned integer), needs to be a multiple of 4 for alignment purposes
0x34 2 Binary Channel Count Number of binary channels (unsigned integer), nb
0x36 2 Analog Channel Count Number of analog channels (unsigned integer), na

Total size: 56 bytes

Comment

An additional comment can be put here in ASCII format. Its size is defined in the header lead-in and it is aligned to 32-bit using bit stuffing.

Channels

This part contains detailed information about all sampled channels. There can be an custom number of channels (defined in lead-in field Binary Channel Count and Analog Channel Count). The channel order determines the channel position in the data block. Each channel can have a different sample size ("Data Size" field), however it is recommended to have equal sizes for improved import into processing tools (e.g. Matlab).

Offset Size (byte) Field Content
0x00 4 Channel Unit Encoded channel unit 1 (integer)
0x04 4 Channel Scale Channel scaling in power of tens, ignored for binary channels (integer)
0x08 2 Data Size Channel sample size in bytes, ignored for binary channels (unsigned integer)
0x0A 2 Valid Data Link Link to additional range valid binary channel (unsigned integer)
0x0C 16 x 1 Channel Name Name of channel (char array)

Total size per channel: 28 bytes

1 Channel unit codings:
Code Unit
0 Undefined
1 Voltage
2 Current
3 Binary
4 Range Valid (binary)

Channel Data

The channel data is stored in a list of blocks. Every data block contains the time stamp of the first sample in UNIX format (UTC) and multiple samples. The binary channels are merged into bit-stuffed 32-bit values, right aligned with the first channel at LSB. The number of binary values nbv is equal to nbv = ceil(nb/32). It may be zero.

An overview over a data block can be seen in the following figure.

Data Block

Data Block Offsets
Offset Size (byte) Field Content
0x00 8 Seconds Timestamp of first sample in UNIX UTC seconds (integer)
0x08 8 Nanoseconds Nanoseconds timestamp of first sample (integer)
0x10 nbv x 4 Binary Values Merged binary channels, right aligned, stuffed to 32-bit
0x#0 CH1 size Analog Channel 1 First sample of analog channel one (integer)
...
Clone this wiki locally