tuhuynh / simple-modbus

Automatically exported from code.google.com/p/simple-modbus
0 stars 0 forks source link

Error writing to slaves, PRESET_MULTIPLE_REGISTERS #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello.
Not working, writing to slaves, from the master. Function:
PRESET_MULTIPLE_REGISTERS

If it works, no problem, the reading of slaves, from the Master. function:
READ_HOLDING_REGISTERS

I used the examples of the library, with some modifications .. but even with 
the original, I have the same problem.

The libraries, are modified to use the serial port # 1 MEGA
Use IDE 1.0.2 and 1.0.3
Arduino Mega 2560

Any idea that I can be doing wrong??

Post Sketch Master and Slave, and modified lib.

thanks
regards

Original issue reported on code.google.com by j.cueli....@gmail.com on 28 Dec 2012 at 4:21

Attachments:

GoogleCodeExporter commented 9 years ago
When the bus is free, at times it does not transmit anyone can produce 
erroneous readings due to noise in the pair
To avoid this, it puts a pull-up resistance in the A and a pull-down, in the B, 
thus, a potential is fixed to the case that all release the bus.

Interestingly, only affected the transmission, that appeared a "1" ghost, which 
falsified the total data received ..

No problems in the library

Original comment by j.cueli....@gmail.com on 5 Jan 2013 at 12:12

GoogleCodeExporter commented 9 years ago
After chatting with Jaime he actually stumbled on the fault himself by 
monitoring the buffer value and realizing it always contains a byte after a 
second packet was sent until the retry count expires. As the libraries have 
been tested extensively on commercial equipment the fault would most likely be 
a hardware or connection fault between his master and slave (two mega2560's). 
Checking the connections to his RS485 converter I suggested to use 680ohm pull 
up and pull down resistors on the master side to ensure the bus is in a known 
state before requesting. This solved his problem.

Original comment by bester.j...@gmail.com on 7 Jan 2013 at 6:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Google translator -> Hello, I would like to know how to write with this library 
in single registrar (function 6 - Modbus). My machine does not have access to 
function 16. thank you.

Original comment by alisson....@gmail.com on 19 May 2014 at 12:45