How to use the node-opcua-service-history.ReadRawModifiedDetails function in node-opcua-service-history

To help you get started, we’ve selected a few node-opcua-service-history examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-aggregates / source / common.ts View on Github external
lambda: (interval: Interval, aggregateConfiguration: AggregateConfigurationOptionsEx) => DataValue,
    callback: (err: Error | null, dataValues?: DataValue[]) => void
) {

    /* istanbul ignore next */
    if (!(node.constructor.name === "UAVariable")) {
        throw new Error("node must be UAVariable");
    }

    /* istanbul ignore next */
    if (processingInterval <= 0) {
        throw new Error("Invalid processing interval, shall be greater than 0");
    }

    const context = new SessionContext();
    const historyReadDetails = new ReadRawModifiedDetails({
        endTime: endDate,
        startTime: startDate,
    });
    const indexRange = null;
    const dataEncoding = null;
    const continuationPoint = null;
    node.historyRead(context, historyReadDetails, indexRange, dataEncoding, continuationPoint,
        (err: Error | null, result?: HistoryReadResult) => {

            /* istanbul ignore next */
            if (err) {
                return callback(err);
            }
            const historyData = result!.historyData as HistoryData;

            const dataValues = historyData.dataValues || [];
github node-opcua / node-opcua / packages / node-opcua-client / src / client_session.js View on Github external
if (!isArray) {
        nodes = [nodes];
    }

    const nodesToRead = [];
    const historyReadDetails = [];
    for( const node of nodes) {
        nodesToRead.push({
            nodeId: resolveNodeId(node),
            indexRange: null,
            dataEncoding: {namespaceIndex: 0, name: null},
            continuationPoint: null
        });
    }

    const ReadRawModifiedDetails = new historizing_service.ReadRawModifiedDetails({
        isReadModified: false,
        startTime: start,
        endTime: end,
        numValuesPerNode: 0,
        returnBounds: true
    });

    const request = new historizing_service.HistoryReadRequest({
        nodesToRead: nodesToRead,
        historyReadDetails: ReadRawModifiedDetails,
        timestampsToReturn: read_service.TimestampsToReturn.Both,
        releaseContinuationPoints: false
    });

    assert(nodes.length === request.nodesToRead.length);
    self.performMessageTransaction(request, function (err, response) {