Skip to content

data format

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

RocketLogger Data (RLD) Format Specification

Data File

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 in UNIX UTC time (unsigned integer)
0x30 4 Comment Length Length of header comment in bytes (unsigned integer)
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. The channel order determines the channel position in the data block. Each channel can have a different sample size, 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)

Data

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

Data Block Size Type
Block 1 Time Stamp Seconds 8B Integer
Nanoseconds 8B Integer
Sample 1 Binary Channels 4B Binary
Channel A1 Variable Integer
...
Channel An Variable Integer
...
Sample n Binary Channels 4B Binary
Channel A1 Variable Integer
...
Channel An Variable Integer
...
Block n Time Stamp Seconds 8B Integer
Nanoseconds 8B Integer
Sample 1 Binary Channels 4B Binary
Channel A1 Variable Integer
...
Channel An Variable Integer
...
Sample n Binary Channels 4B Binary
Channel A1 Variable Integer
...
Channel An Variable Integer
Clone this wiki locally