Query Modifiers Functions
Query Modifiers Functions Overview
You can use query modifier functions to specify various ways to retrieve data from Historian. For example, you can use ONLYGOOD
to request only good-quality data, or INCLUDEREPLACED
to retrieve replaced values.
Query Modifier Functions
ihuBrowseQueryModifiers
Prototype
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.
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
Prototype
Use the ihuClearQueryModifiers
function to clear any previously set query modifiers so that they are not used in subsequent reads.
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
Prototype
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.
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
Prototype
Use the ihuSetQueryModifiers
function to define query modifier criteria for all subsequent data reads.
ihuSetQueryModifiers (
long serverhandle,
MSO Char *CriteriaString
)
Returns
ihuSTATUS_OK
ihuSTATUS_INVALID_PARAMETER
ihuSTATUS_OUT_OF_MEMORY