Cascade Historian: Version 4.1
Prev |  | Next

# bufsize

bufsize -- sets the history buffer size.

## Syntax

    (bufsize history [numvalues])

## Parameters

`history`

  The name of a history defined by the history command.

`numvalues`

  The size of the buffer, in number of data values. The default is `100`. If no value is supplied, or is zero, the command behaves like a query and the buffer size is not modified.

## Returns

The size of the buffer, as an integer, in the format:

        (bufsize history numvalues)

if successful, otherwise

        (error "History history does not exist")

## Description

This command sets the number of data values that will be buffered for the specified history. (There are actually up to twice this number stored at any time, as the Cascade Historian double-buffers its data storage.) When a buffer is full, the data is flushed to disk, as long as an associated file has been assigned (with filebase or `HI_FileBase`). A larger buffer will retain more data in memory and increase the speed of queries on that data if it is within the range of the data in the buffer.

The history data is flushed to disk whenever this command is called. Until this command is used, the history buffer size is set to the initial default value (`100`).

This command corresponds to the Cogent API function `HI_Bufsize` and the `hist_bufsize` dynamic library function.

## Example

        Hist> (bufsize p3)
        (bufsize p3 100)
        Hist> (bufsize p3 800)
        (bufsize p3 800)
        Hist> (bufsize p3)
        (bufsize p3 800)

Prev | Home | Next
bufferIdLength | Up | count

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