How to use the node-opcua-service-subscription.CreateMonitoredItemsResponse function in node-opcua-service-subscription

To help you get started, we’ve selected a few node-opcua-service-subscription 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-client / src / client_monitored_item_base.js View on Github external
subscription.session.createMonitoredItems(createMonitorItemsRequest, function (err, response) {

        /* istanbul ignore next */
        if (err) {
            //xx console.log("ClientMonitoredItemBase#_toolbox_monitor:  ERROR in createMonitoredItems ".red, err.message);
            //xx  console.log("ClientMonitoredItemBase#_toolbox_monitor:  ERROR in createMonitoredItems ".red, err);
            //xx  console.log(createMonitorItemsRequest.toString());
        } else {
            assert(response instanceof subscription_service.CreateMonitoredItemsResponse);

            for (let i = 0; i < response.results.length; i++) {
                const monitoredItemResult = response.results[i];
                const monitoredItem = monitoredItems[i];
                monitoredItem._after_create(monitoredItemResult);
            }
        }
        done(err);
    });
github node-opcua / node-opcua / packages / node-opcua-client / src / client_subscription.js View on Github external
subscription.session.createMonitoredItems(createMonitorItemsRequest, function (err, response) {

                if (!err) {
                    assert(response instanceof subscription_service.CreateMonitoredItemsResponse);
                    const monitoredItemResults = response.results;

                    monitoredItemResults.forEach(function (monitoredItemResult, index) {

                        const clientHandle = itemsToCreate[index].requestedParameters.clientHandle;
                        const monitoredItem = subscription.monitoredItems[clientHandle];

                        if (monitoredItemResult.statusCode === StatusCodes.Good) {

                            monitoredItem.result = monitoredItemResult;
                            monitoredItem.monitoredItemId = monitoredItemResult.monitoredItemId;
                            monitoredItem.monitoringParameters.samplingInterval = monitoredItemResult.revisedSamplingInterval;
                            monitoredItem.monitoringParameters.queueSize = monitoredItemResult.revisedQueueSize;
                            monitoredItem.filterResult = monitoredItemResult.filterResult;

                            // istanbul ignore next
github node-opcua / node-opcua / packages / node-opcua-server / test_to_fix / test_subscriptions.js View on Github external
g_session.createMonitoredItems(request, function (err, response) {
            if (!err) {
                response.should.be.instanceof(subscription_service.CreateMonitoredItemsResponse);
            }
            done(err);
        });
    });
github node-opcua / node-opcua / packages / node-opcua-client / src / client_session.js View on Github external
ClientSession.prototype.createMonitoredItems = function (options, callback) {
    this._defaultRequest(
        subscription_service.CreateMonitoredItemsRequest,
        subscription_service.CreateMonitoredItemsResponse,
        options, callback);
};
github node-opcua / node-opcua / packages / node-opcua-server / src / opcua_server.js View on Github external
const RepublishResponse = subscription_service.RepublishResponse;

const PublishRequest = subscription_service.PublishRequest;
const PublishResponse = subscription_service.PublishResponse;

const CreateSubscriptionRequest = subscription_service.CreateSubscriptionRequest;
const CreateSubscriptionResponse = subscription_service.CreateSubscriptionResponse;

const DeleteSubscriptionsRequest = subscription_service.DeleteSubscriptionsRequest;
const DeleteSubscriptionsResponse = subscription_service.DeleteSubscriptionsResponse;

const TransferSubscriptionsRequest = subscription_service.TransferSubscriptionsRequest;
const TransferSubscriptionsResponse = subscription_service.TransferSubscriptionsResponse;

const CreateMonitoredItemsRequest = subscription_service.CreateMonitoredItemsRequest;
const CreateMonitoredItemsResponse = subscription_service.CreateMonitoredItemsResponse;

const ModifyMonitoredItemsRequest = subscription_service.ModifyMonitoredItemsRequest;
const ModifyMonitoredItemsResponse = subscription_service.ModifyMonitoredItemsResponse;
const MonitoredItemModifyResult = subscription_service.MonitoredItemModifyResult;

const MonitoredItemCreateResult = subscription_service.MonitoredItemCreateResult;
const SetPublishingModeRequest = subscription_service.SetPublishingModeRequest;
const SetPublishingModeResponse = subscription_service.SetPublishingModeResponse;

const CallRequest = call_service.CallRequest;
const CallResponse = call_service.CallResponse;

const ReadRequest = read_service.ReadRequest;
const ReadResponse = read_service.ReadResponse;

const WriteRequest = write_service.WriteRequest;