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

Historian SDK

Latest Multi-Point Update

Sometimes it is necessary to store a new continuous sequence of latest data values that mask another continuous sequence of original (or latest) data values. In this case, the latest multi-point update operation can be used. 

Consider the following figure from the latest single-point update example:

The following figure shows a multi-point update applied to a history fragment. The multi-point update consists of the following latest values, {O at tOP at tPQ at tQ, S at tS}, which mask the original values, {K at tKF at tL, and C at tC}.

A multi-point update is specified as a sequence of HistorianDataValue instances, where the first value's StartDateTime property begins the multi-point update, and the last value's StartDateTime property ends the multi-point update. The last value of the HistorianDataValue is ignored because this instance is used to specify the end date and time of the multi-point update.

Example

HistorianDataValueList myVTQs =
    historian.CreateHistorianDataValueList(HistorianDataCategory.RevisionUpdateMultiple);

HistorianDataValue myO = new HistorianDataValue(tagKey, HistorianDataType.DoubleByteString);
myO.StringValue   = "O";
myO.StartDateTime = new DateTime(2012, 9, 1, 10, 10, 00);
myVTQs.Add(myO);

HistorianDataValue myP = new HistorianDataValue(tagKey, HistorianDataType.DoubleByteString);
myP.StringValue   = "P";
myP.StartDateTime = new DateTime(2012, 9, 1, 10, 11, 00);
myVTQs.Add(myP);

HistorianDataValue myQ = new HistorianDataValue(tagKey, HistorianDataType.DoubleByteString);
myQ.StringValue   = "Q";
myQ.StartDateTime = new DateTime(2012, 9, 1, 10, 40, 00);
myVTQs.Add(myQ);

HistorianDataValue myS = new HistorianDataValue(tagKey, HistorianDataType.DoubleByteString);
myS.StartDateTime = new DateTime(2012, 9, 1, 11, 50, 00);
myVTQs.Add(myS);

Note that the value of HistorianDataValue, "myS" will be ignored, which is why it does not need to be specified. Only the timestamp of the last HistorianDataValue is used to indicate the end date and time of the multi-point update.

Also note that EndDateTime values are ignored for multi-point updates, so they do not need to be specified. EndDateTime values are only applicable to HistorianDataCategory.RevisionUpdateSingle updates, and HistorianDataCategory.RevisionUpdateSingleContinue updates.

Example

while (!historian.SendValues(myVTQs, out error))
{
    // the same code here as in the previous code sample
}

Retrieving with wwVersion = 'LATEST' returns the following result, {A at  tAO at tOP at tP, Q at tQC at tS}, masking all latest VTQs previously stored. Retrieving with wwVersion = 'ORIGINAL' returns the original data, {A at tA, B at tB, C at tC}.