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

Historian SDK

Checking the Current Store-and-Forward Status

The ConnectedToStoreForward property value of the historian connection instance only indicates if the store-and-forward subsystem was started successfully. If you would like to monitor the destination of the streamed data, or find out if there is any data collected locally and waiting to be forwarded, you need to create an instance of the HistorianStoreForwardStatus class and call the HistorianAccess.GetStoreForwardStatus() method to get the current status of the store-and-forward subsystem.

Example

HistorianStoreForwardStatus sfStatus = new HistorianStoreForwardStatus();
for (;;)
{
    historian.GetStoreForwardStatus(ref sfStatus);
    if (!sfStatus.Pending)
        break;
    Console.WriteLine("Store/forward status is pending");
    Thread.Sleep(1000);       
}

if (sfStatus.ErrorOccurred)
    Console.WriteLine("Store/forward error: {0}", sfStatus.Error.ErrorDescription);

Console.WriteLine("DataStored = {0}, Storing = {1}", sfStatus.DataStored, sfStatus.Storing);

The DataStored property value will be true if the store-and-forward subsystem has some data to be forwarded to the historian server. You may need to know the value of that property if you would like to postpone shutting down your SDK application until it forwards all its locally stored data.

The Storing property value will be true if the current or upcoming streamed data flow will be redirected by the managed HCAL to the store-and-forward engine instead of being sent to the historian server. This property value might be helpful if you would like to implement some user interface element that shows whether the data flow is going (or would go) to the historian server or getting (or would be) stored locally.

If you are not interested in the information provided by those properties, you do not need to check the store-and-forward status.