morkai / h5.modbus

Implementation of the MODBUS IP/ASCII/RTU master and slave over TCP/UDP/Serial for Node.js.
https://miracle.systems/p/h5.modbus
MIT License
28 stars 21 forks source link

The data address is not an allowable address for the server (or slave). #13

Closed micha1983 closed 7 years ago

micha1983 commented 7 years ago

HI,

i want to read the following modbus address over TCP.

ID 2 Modbusaddress: 30775

But everytime i get the following errormessage. can somebofy help me with that?

0x03 (RES) Exception (2): Illegal Data Address: The data address received in the query is not an allowable address for the server (or slave).

with qModMaster.exe i'm able to read the address. can i adjust the max allowed value somewhere?

thanks for the feedback.

Greetings Michael

morkai commented 7 years ago

Try

const startingAddress = 30775;
const quantity = 1;
const unit = 2;

master.readHoldingRegisters(startingAddress, quantity, {unit: unit})

This exception is returned as a response from the server. It's not generated client-side.

micha1983 commented 7 years ago

Thanks. Is working great.