Node OPC-UA: Cannot find dataType Definitions
Asked Answered
W

0

6

Node v16.14.2

Node-OPC-UA v2.75.0

Hi,

I'm currently running into a problem when reading large ExtensionObjects from a S7-1500 with Custom DataTypes. At the first read process of those ExtensionObjects I'm getting a lot of error messages, telling me that the library can't find dataType Definitions. However, after those error logs, the read process works just fine and I can successfully access my data.

Here is the error output:

17:20:35.217Z :populate_data_type_manager_104:50    Error Error:  Cannot find dataType Definition ! with nodeId =ns=2;i=6522
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:34:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.240Z :populate_data_type_manager_104:177   err= Error
 ...                                                    at assert (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-assert\source\index.ts:12:21)
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:175:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.293Z :populate_data_type_manager_104:50    Error Error:  Cannot find dataType Definition ! with nodeId =ns=2;i=6525
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:34:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.294Z :populate_data_type_manager_104:177   err= Error
 ...                                                    at assert (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-assert\source\index.ts:12:21)
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:175:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.347Z :populate_data_type_manager_104:50    Error Error:  Cannot find dataType Definition ! with nodeId =ns=3;i=3400
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:34:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.348Z :populate_data_type_manager_104:177   err= Error
 ...                                                    at assert (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-assert\source\index.ts:12:21)
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:175:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.441Z :populate_data_type_manager_104:50    Error Error:  Cannot find dataType Definition ! with nodeId =ns=3;i=3500
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:34:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.443Z :populate_data_type_manager_104:177   err= Error
 ...                                                    at assert (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-assert\source\index.ts:12:21)
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:175:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.732Z :populate_data_type_manager_104:50    Error Error:  Cannot find dataType Definition ! with nodeId =ns=2;i=15889
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:34:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.734Z :populate_data_type_manager_104:177   err= Error
 ...                                                    at assert (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-assert\source\index.ts:12:21)
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:175:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.798Z :populate_data_type_manager_104:50    Error Error:  Cannot find dataType Definition ! with nodeId =ns=2;i=15888
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:34:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)
17:20:35.800Z :populate_data_type_manager_104:177   err= Error
 ...                                                    at assert (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-assert\source\index.ts:12:21)
 ...                                                    at C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\source\private\populate_data_type_manager_104.ts:175:19
 ...                                                    at Generator.next (<anonymous>)
 ...                                                    at fulfilled (C:\Users\me\Desktop\my-opcua-client\node_modules\node-opcua-client-dynamic-extension-object\dist\private\populate_data_type_manager_104.js:5:58)
 ...                                                    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Here is my (relevant) code logic:

const opcClient = OPCUAClient.create({
  applicationName: 'my-opc-client',
  securityMode: MessageSecurityMode.None,
  securityPolicy: SecurityPolicy.None,
  endpointMustExist: true,
  keepSessionAlive: true,
});
await opcClient.connect(<myIp>);
const opcSession = await opcClient.createSession();

opcClient.on('close', () => {
  logger.error('OPC-Client has closed the connection');
});

opcClient.on('abort', () => {
  logger.error('OPC-Client has aborted the connection');
});

opcClient.on('connected', () => {
  logger.error('OPC-Client is connected');
});

opcClient.on('connection_lost', () => {
  logger.error('OPC-Client has lost the connection');
});

opcClient.on('connection_reestablished', () => {
  logger.info('OPC-Client has reestablished the connection');
});

const mainLoop = async () => {
  try {
    const processData = await opcSession.read(
       [
         { nodeId: 'ns=3;s="020_FIFO_OPCUA"."Setpoints"' },
         { nodeId: 'ns=3;s="020_FIFO_OPCUA"."Actuals"' }
       ]
    );
    await writeToDatabase(processData);
    setTimeout(() => mainLoop(), 500);
  } catch (error : any) {
    logger.error(error.message);
    setTimeout(() => mainLoop(), 5000);
  }
};
mainLoop();

Is there something, I'm doing terrible wrong? On the server-side there doesn't seem to be a problem.

Support for <=1.3 dataTyles is enabled.

Help is highly appreciated!

Wellchosen answered 26/7, 2022 at 20:23 Comment(3)
I dont know your specific problem but I made a project using Node-OPC-UA library and on event connection_reestablished I basically had to re-explore all the tree to remake all the connections between tags (by closing and reopening a new session) otherwise I wasn't able to read any data from that tags.Reams
Yeah, I already tried this and it does not seem to fix the problem, unfortunately. What errors did you get, when you didn't create a session after a reconnection?Wellchosen
Basically I remember that after connection_lost and connection_reestablished I had no errors but I lost the update event on tags (I mean the event that will be raised if tag changes his value). So I had to close existing session, close existing connection. Then restart from the beginning: connection, session, explore, create tags and update event...Reams

© 2022 - 2024 — McMap. All rights reserved.