hist_interpolate_data

hist_interpolate_data -- interpolates a history and returns data.

Syntax

hist_interpolate_data (hist_task, history, interpolator[, start[, duration[, args ...]]])
    

Parameters

hist_task

The task object corresponding to the Cascade Historian. See locate_task in the Gamma manual.

history

The name of the history to use.

interpolator

The name of the interpolator to use, as described below.

start

The start of the time range of interest for query. If this value is 0 or is not supplied, it defaults to the time of the first data value available for the history.

duration

The amount of time, in seconds, over which to perform the interpolation. If this value is 0 or is not supplied, it defaults to the length of time between that specified by start and the time of the last data value available for the history.

args

Arguments to the specified interpolator, as required, passed as strings.

Returns

A binary buffer containing the requested X-Y pairs as doubles.

Description

This is a convenience function that combines hist_interpolate, hist_buffer_id_read, and hist_buffer_id_destroy. It causes the Cascade Historian to perform the requested interpolation on its history data, producing a temporary buffer which is read (copied to the user Gamma program) and subsequently destroyed.

The following choices are available for the interpolator argument:

Note

The NoInterpolator function is currently the only one that requires no additional parameters, making it possible to not supply start or duration. For the other interpolator functions, setting start or duration to 0 forces the default values.

This function corresponds to the Cogent API function HI_InterpolateData.

Example

    Gamma> length (a = hist_buffer2array (hist_interpolate_data(tsk, "p6", "PeriodicInterpolator", 0.0, 0.0, "0.1")));
    37
    Gamma> a[12];
    {HI_stVALUE (value . 103.018446) (xaxis . 1025721206.7)}

Copyright 1995-2002 by Cogent Real-Time Systems, Inc.