Modbus485Slave Adress


in this library, how can change the onRead startingAddress?



It’s described in the Modbus485Slave documentation, see onRead(callback) method and example:

modbus.onRead(function(slaveID, functionCode, startingAddress, quantity){
  server.log("Slave ID : " + slaveID);
  server.log("Function Code: " + functionCode);
  server.log("Starting Address : " + startingAddress);
  server.log("Quantity : " + quantity);
  return [true,false,false,true,true]; }.bindenv(this));

Is that not what you are looking for?

– Terrence


Hi terrence,
precisely that code I have implemented, but I indicated address 99, I need to change it,



Sorry for the slow reply. It would be easiest if you could post the code, or send it to terrence [ at]

– Terrence


i need some code help,
I’m using the imp gateway in a industrial plant to obtain a data from a web page … and send it via modbus rs485 to a plc branded Foxboro de Schenider.
the code is here

the tests work well,
but when I connect the gateway to the plc I have a doubt on which modbus registry address is being sent because the plc does not read it, I already tested plc simulating sending information from a pc program and if it arrives.
if I wanted to change that modbus shipping address, how to do it?

with the debugger obtain it.

any suggest is welcome!