ihuReadInterpolatedValueEx
Use the ihuReadInterpolatedValueEx
function to return the number of samples of a tag interpolated to a given date and time with filters and query modifiers by using pszFilterExpression
and CriteriaString
.
Prototype
ihuErrorCode IHUAPI ihuReadInterpolatedValueEx
(
long serverhandle, // [in] used for communication with server
int number_of_tags, // [in] the number of tags to retrieve
IHU_DATA_SAMPLE *pSamples, // [in/out] user fills tagname and timestamp and the API fills other fields
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
ihuErrorCode *error_returns // [out] populated with per tag error
);
Remarks
To skip filtering, you can pass NULL
to pszFilterExpression
and ihuExactTime
to FilterMode
, or you can use ihuReadInterpolatedValue().
Pass NULL
to CriteriaString
if you do not use a QueryModifier
.
You can retrieve values for multiple tags with one call. A single sample for each requested tag is returned.
For each tag, set only the tagname and time stamp fields in IHU_DATA_SAMPLE
. All other fields are set by the function. The time stamp in the first requested tag is used for all tags.
Data is returned based on the data type of the tag.
The data quality returned is either ihuOPCGood
or ihuOPCBad
, and the substatus is always ihuOPCNonspecific
.
If you want to specify a time stamp, you must do so in IHU_DATA_SAMPLE
for the first requested tag.
Returns
The ihuReadInterpolatedValueEx
function 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