Returned Data
- Last UpdatedJul 13, 2023
- 2 minute read
The following properties are returned for each data record of the query.
-
DateTime: Time of the trend sample in seconds since 1970 as an integer in UTC (Universal Time Coordinates).
-
MSeconds: Millisecond component of the time of the trend sample as an integer. This value is inbetween 0 and 999.
-
Value: Trend value of the sample as a double.
-
Quality: The quality information associated with the trend sample as an unsigned integer. The Quality property contains specific information in each bit in the unsigned integer.
To interpret the quality code, converted to its underlying binary value (for example, 0001 0001 0011) and read the bits from right to left. Each bit represents the following:
Value Type (Bits 0 - 3)
-
ValueType_None (0): There is no value in the given sample. Ignore the sample value, time and quality.
-
ValueType_Interpolated (1): The value has been interpolated from data around it.
-
ValueType_SingleRaw (2): The value is based on one raw sample.
-
ValueType_MultipleRaw (3): The value has been calculated from multiple raw samples.
Value Quality (Bits 4 - 7)
-
ValueQuality_Bad (0): Ignore the value of the sample as there was no raw data to base it on.
-
ValueQuality_Good (1): The value of the sample is valid, and is based on some raw data.
Last Value Quality (Bits 8 - 11)
-
LastValueQuality_Bad (0): The value of the sample should be ignored as there was no raw data to base it on.
-
LastValueQuality_Good (1): The value quality of the last raw sample in the period was good.
-
LastValueQuality_NotAvailable (2): The value quality of the last raw sample in the period was Not Available.
-
LastValueQuality_Gated (3): The value quality of the last raw sample in the period was Gated.
Partial Flag (Bit 12)
When the Partial Flag is set to 1 it indicates that the sample may change the next time it is read. This occurs when you get samples right at the current time, and a sample returned is not necessarily complete because more samples may be acquired in this period.
-
Quality examples
If the returned quality code is 275, the binary conversion is 0001 0001 0011.
Reading from right to left, the quality code includes the following information:
-
Bit 0: ValueType_None (0): There is no value in the given sample. Ignore the sample value, time and quality.
-
Bit 1: ValueType_Interpolated (1): The value has been interpolated from data around it.
-
Bit 4: ValueQuality_Bad (0): Ignore the value of the sample as there was no raw data to base it on.
-
Bit 8: LastValueQuality_Bad (0): The value of the sample should be ignored as there was no raw data to base it on.
If the returned quality code is 4609, the binary conversion is 0001 0010 0000 0001.
Reading from right to left, the quality code includes the following information:
-
Bit 0: ValueType_None (0): There is no value in the given sample. Ignore the sample value, time and quality.
-
Bit 9: LastValueQuality_Good (1): The value quality of the last raw sample in the period was good.
-
Bit 12: The Partial Flag is set to 1 indicating that the sample may change the next time it is read.