davidLin7692 / pymodbus

Automatically exported from code.google.com/p/pymodbus
0 stars 0 forks source link

synchronous-client.py error #51

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Run the synchronous-client.py script

Error:

Traceback (most recent call last):
  File "synchronous-client.py", line 105, in <module>
    rq = client.readwrite_registers(1, [20]*8)
  File "/Users/andresandreu/Documents/workspace/ModBus Honeypot/src/pymodbus/client/common.py", line 129, in readwrite_registers
    request = ReadWriteMultipleRegistersRequest(*args, **kwargs)
TypeError: __init__() takes exactly 5 arguments (3 given)

Can you guys define the dictionary and other params expected to be passed in to 
the readwrite_registers function? It looks like the dictionary expects some 
key/val pairs with keys such as "transaction","protocol","unit" but I wanted to 
make sure. Thanks.

Original issue reported on code.google.com by andresan...@gmail.com on 18 Aug 2011 at 2:18

GoogleCodeExporter commented 9 years ago
You are right, I have it commented in the actual request, but not on the 
simplified interface.  I will add it when I get home.  Until then, here are the 
actual parameters:

        :param unit: The slave unit this request is targeting
        :param read_address: The address to start reading from
        :param read_count: The number of registers to read from address
        :param write_address: The address to start writing to
        :param write_registers: The registers to write to the specified address

Original comment by Bashw...@gmail.com on 18 Aug 2011 at 5:51

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r153.

Original comment by Bashw...@gmail.com on 30 Aug 2011 at 4:09