ihuRetrieveSampledDataEx

Use the ihuRetrieveSampledDataEx function to return sampled data based on the raw samples stored in the archive. Interpolated, Trend, and Lab are example SamplingMode values. Use this function with hybrid sampling modes such as TrendToRaw or InterpolatedToRaw to return the sampling mode that was actually used.

Prototype

ihuRetrieveSampledDataEx {
long serverhandle, // [in] which server to fetch from
IHU_TIMESTAMP StartTime, // [in] Start time for the query
IHU_TIMESTAMP EndTime, // [in] End time for the query
ihuSamplingMode SamplingMode, // [in] The requested sampling mode
unsigned long NumberOfSamples, // [in] 0 or num samples to return
IHU_DATA_INTERVAL Interval, // [in] 0 or sampling interval in units provided by IntervalType
IHU_RETRIEVED_DATA_RECORDS_EX *DataRecords // [in/out] - caller fills in tagnames of the structures and API will
};

Remarks

To request data, you can specify a number of samples or a time interval. Set one parameter to a non-zero value and the other to 0. To split the duration, divide the time from start to finish into evenly spaced time intervals.

If you are not using hybrid sampling modes, use ihuRetrieveSampledData().

Returns

The ihuReadRawDataByTimeEx function returns ihuSTATUS_OK when values are successfully retrieved, and returns errors on:

  • Read timeouts
  • User is not a member of the ih Readers security group
  • Tag not found