ST-node-ethernet-ip
ST-node-ethernet-ip copied to clipboard
PLC.disconnect() Does not Clear Timers
Is there currently a disconnect option for this? I'm using process.exit() to exit out of my function instead of waiting for a timeout:
async function readPLC() {
try {
await PLC.connect('192.168.0.1, 0);
const tagData = {};
for (const tagName of tagArray) {
const tag = new Tag(tagName);
await PLC.readTag(tag);
tagData[tagName] = tag.value;
}
console.log(JSON.stringify(tagData, null, 2));
process.exit(0);
} catch (err) {
console.error(JSON.stringify({ error: err.message }, null, 2));
process.exit(1);
}
}
readPLC();