ihuReadCurrentValue

Use the ihuReadCurrentValue function to return the current tag value. The current tag value has a specific definition in Historian, but is generally the last raw sample sent to the archiver for that tag.

Prototype

ihuReadCurrentValue {
  in long serverhandle,
  in int number_of_tags,
  in/out IHU_DATA_SAMPLE *pSamples,
  out ihuErrorCode *error_returns
};

Remarks

You can retrieve current values for multiple tags with one call. A single sample for each requested tag is returned.

For each tag, set only the tagname field in IHU_DATA_SAMPLE. All other fields are set by the function.

Data is returned based on the data type of the tag.

Returns

The ihuReadCurrentValue function returns errors in two ways. The function has a return code, and each tag name has an error code. Check function-level errors before you examine tag-level errors.

Both are ihuSTATUS_OK when the current value is successfully retrieved.

The ihuReadCurrentValue function can return errors on read timeouts or when the user is not a member of the ih Readers security group.

For example, each tag can return an error in cases where tags are not found or have no raw samples.