Home I am trying to read multiple items from opc ua server using opc ua nodejs sample client code. I am getting error
Reply: 0

I am trying to read multiple items from opc ua server using opc ua nodejs sample client code. I am getting error

user1844
1#
user1844 Published in April 19, 2018, 9:55 am

I am trying to read multiple items from opc ua server using opc ua nodejs sample client code. For one variable I could able to read the value successfully. But when I tried for more than one variable I am getting error.

function(callback){
var variable  = new variables;
for(var i=0; i<Object.keys(nodeIds).length;i++){
console.log(Object.values(nodeIds)[i]);
var nodeToRead = {nodeId:Object.values(nodeIds)[i], AttributeId : opcua.AttributeIds.Value};
the_session.read(nodeToRead,variable.MaxArrayLength, (err, datavalue)=>{
if(!err){
console.log(Object.keys(nodeIds)[i].toString(), datavalue.value.value.toString());
}
callback(err);
});
callback();
}

I have included this code in async.series(). I am getting following error: ERROR !!! , please check here !!!! callback may be called twice !! Error:

Callback was already called.
    at E:\work\example projs\opcua\node_modules\async\dist\async.js:955:32
    at E:\work\example projs\opcua\node_modules\async\dist\async.js:3871:13
    at async.series.opcua.ClientSubscription.requestedPublishingInterval (E:\work\example projs\opcua\sinumerikClient.js:85:13)
    at E:\work\example projs\opcua\node_modules\async\dist\async.js:3866:24
    at replenish (E:\work\example projs\opcua\node_modules\async\dist\async.js:998:17)
    at iterateeCallback (E:\work\example projs\opcua\node_modules\async\dist\async.js:983:17)
    at E:\work\example projs\opcua\node_modules\async\dist\async.js:958:16
    at E:\work\example projs\opcua\node_modules\async\dist\async.js:3871:13
    at E:\work\example projs\opcua\sinumerikClient.js:46:13
    at E:\work\example projs\opcua\node_modules\node-opcua-client\src\client_session.js:230:16
MessageBuilder : ERROR DETECTED IN event handler
Error: Callback was already called.
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.486733 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO