Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read the value of the coil after writing on it #48

Open
saadsaeed123 opened this issue Sep 23, 2019 · 0 comments
Open

How to read the value of the coil after writing on it #48

saadsaeed123 opened this issue Sep 23, 2019 · 0 comments

Comments

@saadsaeed123
Copy link

saadsaeed123 commented Sep 23, 2019

Hello,

I am using the function 'writeSingleCoil' to write value 1 on address 5.
The example is given below:
var modbus = require("modbus-stream");
modbus.tcp.server({ debug: "server" }, (connection) => {
connection.writeSingleCoil({ address: 5, value: 1 }, (err, info) => {
console.log("Write Request: Server");
console.log("response", info.response);
});
}).listen(12345, () => {
modbus.tcp.connect(12345, { debug: "client" }, (err, connection) => {
connection.on("write-single-coil", (request, reply) => {
console.log("Write Request: Client");
console.log(request.request.value);
reply(null, 2,1);
});
});
});
My Questions are:

  1. Is this value getting stored somewhere in the memory?
  2. Can I retrieve the the saved value?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant