Open DheemanthBhat opened 3 years ago
Hi, How do we know that connection is still active before attempting to write data to PLC? I am currently using
if(s7Connection.isoConnectionState !== 4) { throw new Error("Not connected to PLC"); } else { s7Connection.writeItems(address, data, cb); }
Should we call initiateConnection for every plc operation (read or write to data-blocks)? something like:
initiateConnection
s7Connection.initiateConnection(s7ConnectionDetails, err => { if (err) { reject('Error connecting to PLC.'); } else { s7Connection.writeItems(addresses, data, writeStatus => { s7Connection.dropConnection(() => { resolve(writeStatus); }); }); } });
Please help!
Hi, How do we know that connection is still active before attempting to write data to PLC? I am currently using
Should we call
initiateConnection
for every plc operation (read or write to data-blocks)? something like:Please help!