1

I'm trying to get all element in plc by using crawler.read method in node-opcua library. At first I was getting TypeError: Cannot read properties of undefined (reading '0') at /node_modules/node-opcua-client-crawler/dist/node_crawler_base.js:27:49. When I look at node_crawler_base.js file I realized that in catch it says: Transaction has timed out (60000 ms). I believe it is giving me this undefined (reading '0') error because session.read is time out. I tried several ways to increase 60000 ms but none of them work. Here is my current code:

const items = [];
const client = opcua.OPCUAClient.create({
    keepSessionAlive: true,
    requestedSessionTimeout: 20000000,
    requestedPublishingInterval: 1000,
    requestedMaxKeepAliveCount: 2,
    requestedLifetimeCount: 100,
    maxNotificationsPerPublish: 10,
    publishingEnabled: true,
    priority: 10,
});
await client.connect(url);
const session = await client.createSession(userInfo);
const crawler = new NodeCrawler(session);
crawler.on("browsed", function (element) {
    items.push(element);
  }
});
await crawler.read(node.topic);

Is there a way to increase this time out value?

Jantoma21
  • 395
  • 4
  • 10

0 Answers0