larst509
hi.

i am trying to read to ds18b20 sensors, and put their value into some memory words 

but i get this error when trying to  upload to the arduino 

does anyone have a good advice?

Br. lars

Skærmbillede 2023-02-17 165442.png
Reply 1 0
thiagoralves
There aren't any memory words available on the Arduino due to the lack of RAM. If you're using something other than a Uno there are a few unmapped %QW positions you can use (I think up to %QW32 if I'm not mistaken). Check the Modbus addressing table on the site documentation for more info.
Reply 1 0
Ruben Loredo
There aren't any memory words available on the Arduino due to the lack of RAM. If you're using something other than a Uno there are a few unmapped %QW positions you can use (I think up to %QW32 if I'm not mistaken). Check the Modbus addressing table on the site documentation for more info.
Hello, I'm scaning all holding Registers on Arduino UNO ATmega 328P but it don´t has 33 Words (%QW0 – %QW32) as documentation says.
 
[203128%2F9111640%2Fmceclip0]
 
I think only has 31 (%QW0 – %QW30).
When i try to read 33 or 32 Holding Registers i get the message "Illegal Data Address" like the next image:
 
[203128%2F9111637%2Fmceclip0]
 
 
When i read only 31 Holding Registers it works fine and get values like the next image:
 
[203128%2F9111638%2Fmceclip0]
 
What do you thinks is happening there?
Reply 0 0
thiagoralves
You are right, the Uno has only 32 registers, not 33. I'll fix the documentation. Thanks for pointing it out.
Reply 1 0
Ruben Loredo
You are right, the Uno has only 32 registers, not 33. I'll fix the documentation. Thanks for pointing it out.
Hello again, sorry for insiste but i could not read 32 register, only 31, from 0 to 30. I found the error.

[203128%2F9114476%2Fmceclip0]
 
 
Ther is defined 32 spaces for Holding but the problem is on "ModbusSlave.cpp" file in line 556, asking for "(startreg+numregs) >= (modbus.holding_size +..." greater or equal than.

So when i try to read 32 spaces from address 0, then the question is (0+32) >= (32+0+0) and the response is TRUE and get "exceptionResponse(MB_FC_READ_REGS, MB_EX_ILLEGAL_ADDRESS);"

So the solution is simply, erase "=" and only ask for ">" like the next image...
 
[203128%2F9114478%2Fmceclip0]
 
And finally i can get data from de last address number 31 (0 to 31)
 
[203128%2F9114479%2Fmceclip0]
 
I realy hope to help and contribuite to the project.
For my project is very important read 32 Registers
Reply 0 0
Reply