Display Mode
- Last UpdatedFeb 05, 2024
- 2 minute read
The data returned can vary drastically depending on the display mode of the TrnQuery. The display mode is split into the following mutually exclusive options:
Ordering Trend sample options
-
0 - Order returned samples from oldest to newest
-
2 - Order returned samples from newest to oldest. This mode is not supported when the Raw data option has been specified.
Condense method options
-
0 - Set the condense method to use the mean of the samples.
-
4 - Set the condense method to use the minimum of the samples.
-
8 - Set the condense method to use the maximum of the samples.
-
12 - Set the condense method to use the newest of the samples.
Timestamp options
-
0 - Returns the mean timestamp for all of the samples in the sample period.
-
33554432 - Returns the actual timestamp of the minimum/maximum/newest sample (depending on the current condense method setting). A condense method of "mean" will still return the mean timestamp for all of the samples in the sample period.
Example
The following table represents samples every ten minutes across an hour.
|
0:10:00 |
40 |
|
0:20:00 |
70 |
|
0:30:00 |
60 |
|
0:40:00 |
20 |
|
0:50:00 |
10 |
|
1:00:00 |
50 |
Based on the current condense method setting (see above), the following would be returned when the timestamp option is set to 33554432.
-
0 (mean) — the timestamp = 0:35:00 (10 + 20 + 30 + 40 + 50 + 60 / 6 = 210 / 6 = 35)
-
4 (minimum) — value = 10; timestamp = 0:50:00.
-
8 (maximum) — value = 70, timestamp = 0:20:00.
-
12 (newest) — value = 50, timestamp = 1:00:00.
Stretch method options
-
0 - Set the stretch method to step.
-
128 - Set the stretch method to use a ratio.
-
256 - Set the stretch method to use raw samples (no interpolation).
Gap Fill Constant option
-
n - the number of missed samples that the user wants to gap fill) x 4096.
Last valid value options
-
0 - If we are leaving the value given with a bad quality sample as 0.
-
2097152 - If we are to set the value of a bad quality sample to the last valid value (zero if there is no last valid value).
Raw data options
-
0 - If we are not returning raw data, that is we are using the condense and stretch modes to compress and interpolate the data.
-
4194304 - If we are to return totally raw data, that is no compression or interpolation. This mode is only supported if we have specified the DataMode of the query = 1. When using this mode, more samples than the maximum specified above will be returned if there are more raw samples than the maximum in the time range.