Code Monkey home page Code Monkey logo

Comments (4)

sante85 avatar sante85 commented on July 22, 2024

@na7q you want active this in attachment?
333594754_555767513199827_7414510881257411052_n

from epevermodbus.

GitHubUser655321 avatar GitHubUser655321 commented on July 22, 2024

I'm here for the same reason, to control the Load Control Relay.

The documentation says the address is 2;

Number: H3
Variable Name: Manual control the load
Address: 2
Description: When the load is manual mode,1-manual on 0 -manual off

To turn it on I, I try;
self.write_registers(0x2, [1])

I get error;
minimalmodbus.IllegalRequestError: Slave reported illegal data address

I've tried;
self.write_registers(0x02, [1])
with the same results.

from epevermodbus.

rosswarren avatar rosswarren commented on July 22, 2024

Hey @GitHubUser655321 write_registers uses function code 16 and writes integer values. The Control load should be using function code 5. You could try with self.write_bit rather than self.write_registers and pass 0 or 1.

from epevermodbus.

GitHubUser655321 avatar GitHubUser655321 commented on July 22, 2024

Hey @rosswarren - thanks, that worked great!

I put this code in my driver.py file and it does the job;

    def set_manual_control_the_load(self, turn_on):
        if turn_on:
            return self.write_bit(0x2, 1)
        else:
            return self.write_bit(0x2, 0)

I'm sure you can make it more elegant if you decide to add it.

Thanks again!

from epevermodbus.

Related Issues (17)

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.