Query Modifiers Functions

ihuBrowseQueryModifiers

Use the ihuBrowseQueryModifiers function to return a list of all supported query modifiers from the Historian Server. Various versions of the Historian Data Archiver may support different sets of modifiers.

Prototype

ihuBrowseQueryModifiers (
  long serverhandle,
  IHU_QUERY_MODIFIER **QueryModifiers,
  int *NumberOfModifiers
);

Remarks

The NumberOfModifiers parameter returns a total count of modifiers. The QueryModifiers parameter returns a list of supported query modifiers.

Returns

  • ihuSTATUS_OK
  • ihuSTATUS_INVALID_PARAMETER

ihuClearQueryModifiers

Use the ihuClearQueryModifiers function to clear any previously set query modifiers so that they are not used in subsequent reads.

Prototype

ihuErrorCode ihuClearQueryModifiers(void)

Remarks

Use ihuSetQueryModifiers() to set a modifier string to be used in all reads. Call ihuClearQueryModifiers() to stop using that modifier.

Returns

  • ihuSTATUS_OK
  • ihuSTATUS_OUT_OF_MEMORY

ihuRetrieveCalculatedDataEx2

Use the ihuRetrieveCalculatedDataEx2 function with the ihuStateCount and ihuStateTime calculation modes to return calculated data based on the raw samples stored in the archive.

You can request data by specifying a number of samples or an interval. Set one to a nonzero value and the other to 0. To split the duration, divide the time from start to finish into evenly spaced time intervals.

Prototype

ihuRetrieveCalculatedDataEx2
(long serverhandle,
IHU_TIMESTAMP StartTime,
IHU_TIMESTAMP EndTime,
ihuCalculationMode CalculationMode,
ihuDataType StateDataType,
ihuValue StateValue,
unsigned long NumberOfSamples,
IHU_DATA_INTERVAL Interval,
IHU_RETRIEVED_DATA_RECORDS_EX *DataRecords)

Returns

This function returns ihuSTATUS_OK when values are retrieved successfully, and returns the following errors:

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

ihuSetQueryModifiers

Use the ihuSetQueryModifiers function to define query modifier criteria for all subsequent data reads.

Prototype

ihuSetQueryModifiers (
long serverhandle,
MSO Char *CriteriaString
)

Returns

  • ihuSTATUS_OK
  • ihuSTATUS_INVALID_PARAMETER
  • ihuSTATUS_OUT_OF_MEMORY