public BeginReadRaw ( |
||
context | The context for the operation. | |
request | ReadRawModifiedDetails | The request parameters. |
timestampsToReturn | TimestampsToReturn | The timestamps to return with the value. |
indexRange | The range to return for array values. | |
dataEncoding | Opc.Ua.QualifiedName | The data encoding to use for structured values. |
values | DataValueCollection | The values to return. |
Результат | void |
/// <summary> /// Reads the raw data for a variable /// </summary> protected ServiceResult HistoryReadRaw( ISystemContext context, BaseVariableState source, ReadRawModifiedDetails details, TimestampsToReturn timestampsToReturn, bool releaseContinuationPoints, HistoryReadValueId nodeToRead, HistoryReadResult result) { ServerSystemContext serverContext = context as ServerSystemContext; HistoryDataReader reader = null; HistoryData data = new HistoryData(); if (nodeToRead.ContinuationPoint != null && nodeToRead.ContinuationPoint.Length > 0) { // restore the continuation point. reader = RestoreDataReader(serverContext, nodeToRead.ContinuationPoint); if (reader == null) { return(StatusCodes.BadContinuationPointInvalid); } // node id must match previous node id. if (reader.VariableId != nodeToRead.NodeId) { Utils.SilentDispose(reader); return(StatusCodes.BadContinuationPointInvalid); } // check if releasing continuation points. if (releaseContinuationPoints) { Utils.SilentDispose(reader); return(ServiceResult.Good); } } else { // get the source for the variable. IHistoryDataSource datasource = null; ServiceResult error = GetHistoryDataSource(serverContext, source, out datasource); if (ServiceResult.IsBad(error)) { return(error); } // create a reader. reader = new HistoryDataReader(nodeToRead.NodeId, datasource); // start reading. reader.BeginReadRaw( serverContext, details, timestampsToReturn, nodeToRead.ParsedIndexRange, nodeToRead.DataEncoding, data.DataValues); } // continue reading data until done or max values reached. bool complete = reader.NextReadRaw( serverContext, timestampsToReturn, nodeToRead.ParsedIndexRange, nodeToRead.DataEncoding, data.DataValues); // save continuation point. if (!complete) { SaveDataReader(serverContext, reader); result.StatusCode = StatusCodes.GoodMoreData; } // return the dat. result.HistoryData = new ExtensionObject(data); return(result.StatusCode); }
/// <summary> /// Reads the raw data for a variable /// </summary> protected ServiceResult HistoryReadRaw( ISystemContext context, BaseVariableState source, ReadRawModifiedDetails details, TimestampsToReturn timestampsToReturn, bool releaseContinuationPoints, HistoryReadValueId nodeToRead, HistoryReadResult result) { ServerSystemContext serverContext = context as ServerSystemContext; HistoryDataReader reader = null; HistoryData data = new HistoryData(); if (nodeToRead.ContinuationPoint != null && nodeToRead.ContinuationPoint.Length > 0) { // restore the continuation point. reader = RestoreDataReader(serverContext, nodeToRead.ContinuationPoint); if (reader == null) { return StatusCodes.BadContinuationPointInvalid; } // node id must match previous node id. if (reader.VariableId != nodeToRead.NodeId) { Utils.SilentDispose(reader); return StatusCodes.BadContinuationPointInvalid; } // check if releasing continuation points. if (releaseContinuationPoints) { Utils.SilentDispose(reader); return ServiceResult.Good; } } else { // get the source for the variable. IHistoryDataSource datasource = null; ServiceResult error = GetHistoryDataSource(serverContext, source, out datasource); if (ServiceResult.IsBad(error)) { return error; } // create a reader. reader = new HistoryDataReader(nodeToRead.NodeId, datasource); // start reading. reader.BeginReadRaw( serverContext, details, timestampsToReturn, nodeToRead.ParsedIndexRange, nodeToRead.DataEncoding, data.DataValues); } // continue reading data until done or max values reached. bool complete = reader.NextReadRaw( serverContext, timestampsToReturn, nodeToRead.ParsedIndexRange, nodeToRead.DataEncoding, data.DataValues); // save continuation point. if (!complete) { SaveDataReader(serverContext, reader); result.StatusCode = StatusCodes.GoodMoreData; } // return the dat. result.HistoryData = new ExtensionObject(data); return result.StatusCode; }