Code: Select all
var newVariable = new CreateVariableSettings()
{
...
AccessLevel = AccessLevels.CurrentRead | AccessLevels.HistoryRead,
AccessLevelEx = AccessLevels.CurrentRead | AccessLevels.HistoryRead,
TypeDefinitionId = VariableTypeIds.AnalogItemType,
...
};
var var = CreateVariable(Server.DefaultRequestContext, newVariable);
SetVariableConfiguration(var.NodeId, var.BrowseName, NodeHandleType.Internal, null);
My continuation point type.
Code: Select all
private class HistoryReadRawContinuationPoint : HistoryContinuationPoint
{
public DateTime TimestampToUse { get; set; }
}
1. Create a dummy result with a value
2. Create a continuation point.
3. Set the continuation point id in the result
4. Update the continuationpoint array with the new point
5. Trigger the callback.
Code: Select all
protected override HistoryReadResult HistoryReadRaw(RequestContext context, ReadRawModifiedDetails details, HistoryDataHandle nodeHandle, string indexRange, QualifiedName dataEncoding, ref HistoryContinuationPoint continuationPoint)
{
return null;
}
protected override void HistoryReadRaw(RequestContext context, HistoryDataTransactionHandle transaction, ReadRawModifiedDetails details, IList<HistoryDataOperationHandle> operationHandles, IList<HistoryReadValueId> valuesToRead, IList<HistoryContinuationPoint> continuationPoints)
{
for (int i = 0; i < operationHandles.Count; i++)
{
HistoryReadResult result = new()
{
HistoryData = new ExtensionObject(new HistoryData
{
DataValues = new DataValueCollection
{
new UnifiedAutomation.UaBase.DataValue
{
SourceTimestamp = details.StartTime,
StatusCode = StatusCodes.Good,
Value = 0.23
}
}
})
};
HistoryReadRawContinuationPoint continuationPoint = new()
{
TimestampToUse = details.StartTime.AddTicks(1)
};
result.ContinuationPoint = continuationPoint.Id.ToByteArray();
continuationPoints[i] = continuationPoint;
(transaction.Callback as HistoryReadDataCompleteEventHandler)(operationHandles[i], transaction.CallbackData, result, false);
}
}
When I call from the client again with the continuation point I get a BadContinuationPointInvalid statuscode.
1. Is the HA batch pattern correct? Apart from not being async yet.
2. Do I need to register the continuationpoint with the SDK?
3. And/or do I need to track the points by overriding a function?