Git Product home page Git Product logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Hello,
I agree that the behaviour should be what you are expecting.

I've just pushed a new version with a new unit-test that tries to reproduce 
your problem. 

Can you please try to get it and run:
python functest_modbus_rtu.py RtuTestQueries.testWriteMultipleCoilsIssue23

Does the test pass? In my case, it is ok and the queries seems to be what you 
are expecting.

Did you notice similar issue on other function codes?

Best
luc

Original comment by [email protected] on 11 Oct 2011 at 9:20

  • Changed state: Started

from modbus-tk.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Hello,
Thanks for the quick reaction. I did the test connecting two of my serial ports 
one to each other. The request now looks how it should be, however the test 
failed. The output is following:

Hello
RtuMaster COM6 is opened
RtuServer COM1 is opened
-> 10-15-0-0-0-32-4-204-204-204-204-75-150
-->10-15-0-0-0-32-4-204
handle request failed: Invalid CRC in request
<--129-4
-->204-204-204-75-150
handle request failed: Invalid CRC in request
<--129-4
<- 129-4-129-4
Emodbus_tk.modbus_rtu.RtuServer has stopped

======================================================================
ERROR: testWriteMultipleCoilsIssue23 (__main__.RtuTestQueries)
Write the values of a multiple coils and check that it is correctly written
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Documents and Settings\Petar\Desktop\functest_modbus.py", line 287, in testWriteMultipleCoilsIssue23
    result = self.master.execute(10, modbus_tk.defines.WRITE_MULTIPLE_COILS, 0,output_value=[0, 0, 1, 1]*8)
  File "C:\Documents and Settings\Petar\Desktop\modbus_tk\utils.py", line 26, in new
    raise excpt
ModbusInvalidResponseError: Response address 129 is different from request 
address 10

----------------------------------------------------------------------
Ran 1 test in 1.203s

FAILED (errors=1)


---
One more thing: unittest.sys.argv is somehow not valid for me, so I used only 
"sys.argv" instead.
I forget to mention, I use Python 2.7

Original comment by [email protected] on 11 Oct 2011 at 12:04

from modbus-tk.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
OK it seems that there is a "blank" on the serial link and that it causes the 
rtu server to see 2 different queries.
Can you try to increase the serial timeout by changing the value of 
server._serial.interCharTimeout and server._serial.timeout

I've pushed a new version when timeout is set to 5*to rather that 1.5*to (which 
seems wrong). May be it is noot enough?

Tell me if it fix the issue.
Best
luc

Original comment by [email protected] on 12 Oct 2011 at 6:07

  • Changed state: Accepted

from modbus-tk.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
So, I did some tests with my own code. I played a bit wit the two 
aforementioned parameters and found out, that the best working solution is:
self._serial.interCharTimeout = 1.5 * self._t0 #Line 148
self._serial.timeout = 10 * self._t0 #Line 149

If .timeout is above 5 and less than 10, it's still working, but from time to 
time it's splitting again some queries.
I've just tested with FC5, FC6 and FC16 commands and they are working fine too.

BR
Petar

Original comment by [email protected] on 12 Oct 2011 at 7:32

from modbus-tk.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Hello Petar,
I am ok to increase this timeout to 10*to.
I will commit and publish a new version soon.
Thanks for feedback and your contribution to modbus-tk.
Best
luc

Original comment by [email protected] on 12 Oct 2011 at 7:46

  • Changed state: Fixed

from modbus-tk.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
modbus-tk 0.4.2 has been released and fix the problem

Original comment by [email protected] on 12 Oct 2011 at 8:30

  • Changed state: Verified

from modbus-tk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.