Data - ParamSamplesDoc
The ParamSamplesDoc document
is a data document that contains the properties and values for a collection
of data samples for a single data channel.
The ParamSamplesDoc document
is used to store raw sample values for user specified intervals.
The document contains the field documentInterval that is used to specify the time
range that the raw data samples values have sampled from.
Field | Data Type | Required | Default | Description |
---|---|---|---|---|
id | String | Yes | - | A unique identifier that is referenced by all other documents see section Unique Id Generation. |
configDocId | String | Yes | - | The unique identifier (id) of the ConfigDoc document that this document is associated with. |
paramDefDocId | String | Yes | - | The unique identifier (id) of the ParamDefinitionDoc that holds the properties for the parameter associated with the data values stored in this document. |
startTime | 64-bit Long | Yes | - | A 64-bit Long timestamp specifying the start time of the data that this document holds. The timestamp represents the number of nanoseconds since the reference time of midnight, 1st January 1970. |
endTime | 64-bit Long | Yes | - | A 64-bit Long timestamp specifying the end time of the data that this document holds. The timestamp represents the number of nanoseconds since the reference time of midnight, 1st January 1970. |
min | 64-bit Double | Yes | - | A 64-bit Double value specifying the minimum value of the data that this document holds. |
max | 64-bit Double | Yes | - | A 64-bit Double value specifying the maximum value of the data that this document holds. |
sampleTimes | Array [Byte] | Yes | - | An array of gzip compressed 64-bit Long values. Each value represents the timestamp value of the sample at the associated array index. The timestamp represents the number of nanoseconds since the reference time of midnight, 1st January 1970. |
sampleValues | Array [Byte] | Yes | - | An array of gzip compressed 64-bit Double values. Each value represents the sample value at the associated array index. |
sampleCount | 64-bit Double | Yes | - | A 64-bit Long that holds the value for the number of samples in a document. |
dataType | 64-bit Double | Yes | Double | A 64-bit Long that holds the value for the number of samples in a document. Valid options are: Double, Long, Byte.. |
type | Fixed String | Fixed | ParamSamplesDoc | The fixed value is always set to ParamSamplesDoc. |
When used with the Regno Platform, for storage and bandwidth optimization, sampleValues and sampleTimes within this document are stored as a compressed array of bytes, using standard gzip compression.
To read data, sampleValues and sampleTimes can be restored by un-zipping the compressed file, using standard gzip.
To read data, sampleValues and sampleTimes can be restored by un-zipping the compressed file, using standard gzip.
C# Example:
using (var zipStream = new GZipStream(new MemoryStream(data), CompressionMode.Decompress))
using (var resultStream = new MemoryStream())
{
zipStream.CopyTo(resultStream);
return resultStream.ToArray();
}
using (var zipStream = new GZipStream(new MemoryStream(data), CompressionMode.Decompress))
using (var resultStream = new MemoryStream())
{
zipStream.CopyTo(resultStream);
return resultStream.ToArray();
}