history

history — creates a new history.

Syntax

(history name [point])
    

Arguments

name

The name of the history. It must be a valid Cascade DataHub point name unless the optional point parameter is used.

point

The Cascade DataHub point name to associate with the history. If not supplied, then the Cascade DataHub point named by the name is associated with the history.

Returns

t (true) if successful, otherwise (error).

Description

This command creates a new history and assigns it a name. This is required before any other commands or functions on the specified history can be applied. The history will be enabled as soon as it is created. A history can be associated with a Cascade DataHub point, so that the history is updated whenever the datahub point is updated. (See the register command or the HI_Register function.)

Typically, the point and history names are the same, and the point argument need not be specified. By using the point argument, it becomes possible to associate more than one history to the same datahub point. In this case, a single datahub point update will cause all the associated histories to be updated. This can be useful if you need histories of the same data but with different deadband settings. (This could provide, for example, both a high-resolution history as well as a more compact history using the deadband filters). The point name can be completely different from the history name, or can be the same as one of the histories.

[Note]

When multiple histories are associated with the same point, registering or unregistering one of the histories will do the same to all the other histories sharing the same point. This applies when defining a new history: if a point is associated with a history that has already registered, then the new history is also automatically registered. If control is required over which histories (that share a common point) receive data, then the enable/disable commands (or their corresponding functions) must be used.

If the history already exists, this command does nothing.

This command corresponds to the Cogent C API function HI_History and the hist_history dynamic library function.

Example

(history p1)
(history p2)

(history p3)
(history db-1 p3)
(history db-2 p3)