ihuRetrieveCalculatedDataEx3

Use the ihuRetrieveCalculatedDataEx3 function to return sampled data based on the raw samples stored in the archive with filters and query modifiers by using pszFilterExpression and CriteriaString. Average, Minimum, and Count are example CalculationMode values.

Prototype

ihuRetrieveCalculatedDataEx3 {
long serverhandle, // [in] which server to fetch from
IHU_TIMESTAMP StartTime, // [in] Start time of query
IHU_TIMESTAMP EndTime, // [in] End time of query
ihuCalculationMode CalculationMode, //[in] Calculation Mode
MSO_Char *pszFilterExpression, // [in] Filter Expression e.g. Tag > 20
IHU_FILTER_MODE FilterMode,   // [in] Filter Modes
MSO_Char *CriteriaString, // [in] QueryModifiers to use with data reads
ihuDataType StateDataType, // DataType of the StateValue to compare for ihuStateCount calculation mode
ihuValue StateValue, // Value to compare for ihuStateCount calculation mode unsigned long NumberOfSamples, IHU_DATA_INTERVAL Interval, // [in] Interval in Milliseconds
IHU_RETRIEVED_DATA_RECORDS_EX *DataRecords // [in/out] - you fill in tagnames of the structures and API will fil
};

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.

To skip filtering, you can pass NULL to pszFilterExpression and ihuExactTime to FilterMode, or you can use ihuRetrieveCalculatedData().

Pass NULL to CriteriaString if you do not use a QueryModifier.

Returns

The ihuRetrieveCalculatedDataEx3 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
  • Filter criteria or query modifiers cannot be set