-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Hi there,
I am using the notify method this to read position feedback from axes, however i am finding that the socket connection closes after approx 10 seconds.
const options = {
host: '10.4.4.1',
amsNetIdTarget: '10.4.4.1.1.1',
amsNetIdSource: '10.4.4.2.1.1',
};
// Reading this...
var myHandle = {
symname: 'GVL.fbRevolve.rPosition',
bytelength: ads.LREAL,
};
var client = ads.connect(options, function() {
this.notify(myHandle);
});
client.on('notification', function(handle) {
console.log(handle.value);
});
client.on('close', function(data) {
console.log('CLOSE', data);
});
client.on('error', function(err) {
console.log('Error: ', err);
});This works correctly for about 10 seconds before the socket is closed.
I thought it may have been a timeout somewhere, maybe the client not sending data frequently enough(?), so have added the following:
var client = ads.connect(options, function() {
this.notify(myHandle);
setInterval(() => {
this.readDeviceInfo(function(err, result) {
if (err) console.log('Error: ', err);
console.log('\nreadDeviceInfo: ', result);
// this.end();
});
}, 1000);
});however after about 10 seconds the following gets thrown:
Error: Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (net.js:407)
at Object.runCommand (ads.js:1014)
at Object.readDeviceInfo (ads.js:295)
at EventEmitter.ads.adsClient.readDeviceInfo (ads.js:60)
at renderer.js:153
Any Ideas how to keep the connect open?
Thanks,
Jon
Metadata
Metadata
Assignees
Labels
No labels