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

Historian SDK

Closing the Storage Connection

Sometimes it is necessary to explicitly flush all original streamed data queued for storage to perform a clean exit from the application. This can be achieved by calling the CloseStorageConnection() method of the HistorianAccess class.

Example

HistorianAccessError error;
if (!historian.CloseStorageConnection(out error))
    Console.WriteLine("Failed to close storage connection: {0}", error.Description);

After the HistorianAccess.CloseStorageConnection() is called, no more storage operations are allowed to be performed, but status checking and retrieval functionality remain accessible. All memory buffers will be flushed either to the historian server, or to the locally running store-and-forward engine. The application can check if there is any locally-stored data that has not been forwarded to the server and either wait for that data to be forwarded or close the historian connection and exit.