Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WRITE_MULTIPLE_COILS writes one coil past range #42

Closed
GoogleCodeExporter opened this issue Apr 17, 2015 · 1 comment
Closed

WRITE_MULTIPLE_COILS writes one coil past range #42

GoogleCodeExporter opened this issue Apr 17, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

This test currently fails:

    def testWriteMultipleCoilsOffByOne(self):
        """Test that correct coils are written at range edges by writing range within range"""
        result = self.master.execute(1, modbus_tk.defines.WRITE_MULTIPLE_COILS, 0, output_value=[1]*20)
        self.assertEqual((0, 20), result)
        result = self.master.execute(1, modbus_tk.defines.WRITE_MULTIPLE_COILS, 5, output_value=[0]*10)
        self.assertEqual((5, 10), result)
        self.assertEqual(tuple([1]*5+[0]*10+[1]*5), self.slave1.get_values("c0-100", 0, 20))

What is the expected output? What do you see instead?
       See above

What version of the product are you using? On what operating system?
      0.4.3

Please provide any additional information below.
     I have the fix and associated test case.  I will push it once I figure out how mercurial works.

Original issue reported on code.google.com by barck...@gmail.com on 27 Feb 2015 at 3:27

@GoogleCodeExporter
Copy link
Author

The unit test and bug fix may be found in the clone barcklay-modbus-tk

Original comment by barck...@gmail.com on 27 Feb 2015 at 3:37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant