roccomuso/node-ads

use multi read

heleon19 opened this issue · 4 comments

Hi
How can I use the multi read function? Tried to pass the handle as array, but didn't work.
Thank's for your advice.
Regards Heleon

Please paste the whole code

Connection is ok, read of single variable is ok.

Example of multi read:

var myHandles =[
 {
    symname: '.light.gp[0]',  
    bytelength: ads.INT,  
},
 {
    symname: '.light.gp[1]',  
    bytelength: ads.INT,  
}
];

var client = ads.connect(options, function() {
    this.mulitRead(myHandles, function(err, handle) {
        if (err) console.log(err)
        console.log(handle.value)
    });
});

Try to put this listeners to catch errors:

client.on('notification', function(handle){
    console.log(handle)
})

client.on('error', function(error) {
    console.log(error)
})

I'm investigating the issue.

@roccomuso it should work properly with 1.4.3