ihuReadRawDataByCountEx

Use the ihuReadRawDataByCountEx function to return the requested number of raw samples for a single tag going forward or backward in time from a specified time stamp by using pszFilterExpression and CriteriaString. In cases where the number of samples available is less than the value specified in the number_of_samples parameter, the function stops returning data.

Prototype

ihuReadRawDataByCountEx {
long serverhandle, // [in] the serverhandle
MSO_Char *tagname, // [in] the single tagname to fetch data for
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
IHU_TIMESTAMP * StartTime, // [in] Start time of query
IHU_TIMESTAMP * EndTime, // [in] End time of query
int * number_of_samples, // [in/out] the number of samples to return and actually returned
int TimeForward, // [in] TRUE if search should be in forward time order
IHU_DATA_SAMPLE **data_values // [out] the returned data samples, unlimited number
};

Remarks

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

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

The time stamp, value, and quality of each raw sample are returned.

Returns

The ihuReadRawDataByCountEx 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