HI_BufferIDRead

HI_BufferIDRead — reads an interpolation buffer.

Syntax

#include <cogent.h>
ST_STATUS HI_BufferIDRead(IP_hTASK  historian,
 char*  retbuf,
 int  buflen,
 int  bufferid,
 int  start,
 int  count,
 HI_stVALUE*  value);

Arguments

historian

The task pointer to the Cascade Historian program.

retbuf

An optional buffer containing an error message.

buflen

The length in bytes of retbuf. If retbuf is non-NULL, this must be a valid non-zero length. If retbuf is NULL, this parameter is ignored.

bufferid

The buffer identifier, as returned by a call to HI_Interpolate.

start

An offset into the buffer for the returned data.

count

The number of values to be read.

values

An array of HI_stVALUEs with at least count elements.

Returns

ST_OK on success. Otherwise ST_ERROR, and the retbuf will contain a NULL-terminated character string with an error message. If the return value is ST_OK, the retbuf may not contain useful information.

Description

This function is used for reading the contents of a buffer created by HI_Interpolate. You are responsible for defining an array (or allocating the memory) to contain the values read. The length of this array can be determined with HI_BufferIDLength.

Some queries can result in large buffers whose size makes it impractical to read with a single IPC message. The default IPC message buffer used by the Cogent C API sets a limit of about 200 values. For higher numbers of values, the start and count parameters can be used to read the buffer in segments.

This function corresponds to the Cascade Historian bufferIdData command and the hist_buffer_id_read dynamic library function.