Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Historian SDK

Opening an Event Connection to the Historian

AVEVA Historian uses a dedicated event storage subsystem to store events. Events can be persisted either in an Microsoft SQL Server database called A2ALMDB or in data files of a proprietary format in the history blocks. A historian server administrator uses the post-installation Configurator tool to configure the storage method. For more information, see the System Platform Installation Guide.

Internally, the managed HCAL opens separate connections for process data and event data to minimize the impact of one on the other and vice versa. For example, there could be some delay in event processing by the SQL Server resulting in the event flow being put into the store-and-forward mode, which should not affect the regular data flow.

We recommend that you to open a separate event connection to send events by specifying the event connection mode in the ConnectionType property if the HistorianConnectionArgs object.

Example

HistorianAccess historianEvents = new HistorianAccess();
HistorianConnectionArgs eventConnectionArgs = new HistorianConnectionArgs();
connectionArgs.ConnectionType = HistorianConnectionType.Event;
connectionArgs.ServerName = "HistorianComputer";
HistorianAccessError error;
if (!historianEvents.OpenConnection(eventConnectionArgs, out error))
    Console.WriteLine("Failed to initiate event connection: {0}", error.Description);

A separate historian event connection proxy can be used only for sending HistorianEvent objects and must have a its own store-and-forward path. It is possible to create a combined connection proxy by specifying both event and process flags.

Example

HistorianAccess historianProcessAndEvent = new HistorianAccess();
HistorianConnectionArgs connectionArgs = new HistorianConnectionArgs();
connectionArgs.ConnectionType = HistorianConnectionType.Event|HistorianConnectionType.Process;
connectionArgs.ServerName = "HistorianComputer";
HistorianAccessError error;
if (!historianProcessAndEvent.OpenConnection(eventConnectionArgs, out error))
    Console.WriteLine("Failed to initiate event connection: {0}", error.Description);

Such a combined proxy will still have two separate connections created internally. The benefit of using a combined prozy is that you need to maintain only one historian connection proxy object and can use it for sending both HistorianEvent and HistorianDataValue objects; however, handling various error conditions might be more complicated.