Sample data storage format
Options
float32 | Each reading is stored in IEEE single precision 32-bit floating point format. |
|---|---|
float64 | Each reading is stored in IEEE double precision 64-bit floating point format. |
calfloat64 | Numerically the same as float64, but no calibration equation is applied to the data; the value is a ratio relative to full-scale, nominally 0.0 to 1.0. |
The format to expect for all schedules can be determined by the storage command (see Related commands below) or from the metadata entry data_format in the Deployment section (section 4) metadata. Once the value for normal deployments is known for a given instrument, it can be assumed that it will not change during the instrument's lifetime. The only case when the format may be different is if the deployment was enabled in calibration mode, in which case the format will be calfloat64.
Layout
Within the sample data for a given schedule, a single sample with N channels (N > 0) will have the form:
Timestamp | 1st channel value | ... | Nth channel value |
All individual data items are stored in memory in little-endian format (least significant byte at lower address). Within a given schedule, all samples occupy the same number of bytes each.
The Timestamp is a 64-bit count of milliseconds elapsed since 1970/01/01 00:00:00, commonly referred to as the Unix epoch. It accounts for leap years, but not leap seconds, time zones or any other adjustments. Note that although the Unix epoch is used as a reference point, the time does not conform exactly to the definition of "Unix time", which is measured in seconds.
All channel values have the same numeric format; one of float32, float64 or calfloat64 (see Options, above). The order in which channel values appear is determined by:
The order in which groups are specified for this schedule.
Within each group, the order in which channels are specified.
These orderings are determined by the schedule and group commands (see Related commands, below).
All channel values have the potential to encode an error value. Error values are denoted by NaNs with an embedded payload (see Errors, below)
Related commands
>> instrument datatype
<< instrument datatype=float32 | float64 | calfloat64
Read-only
Sample data is in the same format for all channels.
Normal deployments will be in either float32 or float64, the choice is configured at the Factory.
>> enable config=<config_label> dataset=<dataset_label> storagemode=normal | calibration
<< enable config=<config_label> dataset=<dataset_label> storagemode=normal | calibration
storagemode is optional and defaults to normal if not specified.
normal selects a data storage format of either float32 or float64, according to the logger's configuration.
calibration always selects a data storage format of calfloat64, regardless of the normal setting.
>> schedule grouplist=<group_label_list ...>
<< schedule grouplist=<group_label_list ...>
The order in which group labels are specified determines the order in which groups appear in the stored data.
>> group channellist=<channel_label_list ...>
<< group channellist=<channel_label_list ...>
The order in which channel labels are specified determines the order in which channels appear within their group in the stored data.
>> dataset <dataset_label> datatype
<< dataset <dataset_label> datatype=float32 | float64 | calfloat64
The data storage format of a historical dataset held in the logger's memory can be queried at any time.
Errors
Errors related to channels are denoted by negative-signed NaN values. In many cases, detecting a NaN as a channel value should suffice to indicate an error has occurred since most error codes are diagnostic/correctable for RBR-only. For conversion from float32 to float64, a 29-bit least-significant-bit-zero-pad of the payload is used (mantissa is left-shifted 29 bits). Conversely, for float64 to float32, a 29-bit least-significant-bit-truncation of the payload is used (mantissa is right-shifted 29 bits). This conversion matches several C compiler and Java intrinsic conversions, but integrators should check intrinsic conversions in their own environments. Except for the case of a general error, the setting of the quiet/signalling bit (float32: 0x00400000, float64: 0x0008000000000000) should not be relied on for error determination; for a general error, the bit will be set.
Error | float32 bits | float64 bits | Description |
|---|---|---|---|
0x7F800000 | 0x7FF0000000000000 | +inf | |
0xFF800000 | 0xFFF0000000000000 | -inf | |
0x7FC0000 | 0x7FF0000000000000 | +NaN | |
0 | 0xFFC0000 | 0xFFF8000000000000 | -NaN; General error condition; error from undefined mathematical operation |
1 | 0xFFC00001 | 0xFFF8000020000000 | ADC error – end of conversion |
2 | 0xFFC00002 | 0xFFF8000040000000 | ADC error – invalid value |
3 | 0xFFC00003 | 0xFFF8000060000000 | Bus error – invalid address |
4 | 0xFFC00004 | 0xFFF8000080000000 | Bus error – frame overflow |
5 | 0xFFC00005 | 0xFFF80000A0000000 | Bus error – locked |
6 | 0xFFC00006 | 0xFFF80000C0000000 | Bus error – cannot transmit |
7 | 0xFFC00007 | 0xFFF80000E0000000 | Bus error – receive timed out |
8 | 0xFFC00008 | 0xFFF8000100000000 | Bus error – invalid frame |
9 | 0xFFC00009 | 0xFFF8000120000000 | Sample error – no sample started |
10 | 0xFFC0000A | 0xFFF8000140000000 | Sample error – sample in progress |
11 | 0xFFC0000B | 0xFFF8000160000000 | Sample error – sample failed |
12 | 0xFFC0000C | 0xFFF8000180000000 | Sample error – averaging failed |
13 | 0xFFC0000D | 0xFFF80001A0000000 | Bus error – packet truncated |
14 | 0xFFC0000E | 0xFFF80001C0000000 | Data error – unable to compute |
15 | 0xFFC0000F | 0xFFF80001E0000000 | Safety – high power consumption |
16 | 0xFFC00010 | 0xFFF8000200000000 | Data error – out of range |
17 | 0xFFC00011 | 0xFFF8000220000000 | Data error – under range |
18 | 0xFFC00012 | 0xFFF8000240000000 | Data error – over range |
19 | 0xFFC00013 | 0xFFF8000260000000 | Sensor error – communications timeout |
20 | 0xFFC00014 | 0xFFF8000280000000 | Sensor error – cannot parse response |
21 | 0xFFC00015 | 0xFFF80002A0000000 | Data error – not calibrated / invalid calibration |
22 | 0xFFC00016 | 0xFFF80002C0000000 | Data error – malformed floating point number |
23 | 0xFFC00017 | 0xFFF80002E0000000 | Data error – no sample logged |