GithubHelp home page GithubHelp logo

Holding Registers about arduinomodbusslave HOT 5 CLOSED

yaacov avatar yaacov commented on June 13, 2024
Holding Registers

from arduinomodbusslave.

Comments (5)

ysmilda avatar ysmilda commented on June 13, 2024

When your EEPROM is empty before uploading the full.ino example all the digital pins should be INPUTS. This means that if you read the Input Status this should reflect the current state of the digital pins you defined. To change the pinMode you should write a 0 (input) or a 1 (output) to the corresponding Holding Register.

From your description I'm not completely sure what it is that you're trying to do.

from arduinomodbusslave.

DpunktS avatar DpunktS commented on June 13, 2024

yes at the very beginning all PINs were inputs. Then I wanted to write in the holding register. Writing always stops with an error and the next time the holding register was read there were 255 in it and all pins are outputs. how do I get the 255 out of the eeprom.

from arduinomodbusslave.

yaacov avatar yaacov commented on June 13, 2024

This is the loop that read the eeprom
https://github.com/yaacov/ArduinoModbusSlave/blob/master/examples/full/full.ino#L52

This is the line handling CB_WRITE_HOLDING_REGISTERS that changes the pinMode
https://github.com/yaacov/ArduinoModbusSlave/blob/master/examples/full/full.ino#L210

so you can:
a. set the eeprom to what needed before the loop in line 52
b. call the device with modbus write holding register to the address that will change the currect binMode.

from arduinomodbusslave.

DpunktS avatar DpunktS commented on June 13, 2024

I have now deleted the EEPROM again so that it is at 0. Nevertheless I cannot write 1 into the EEPROM with QModMaster. Error code: Illegal data value

from arduinomodbusslave.

ysmilda avatar ysmilda commented on June 13, 2024

if (value != INPUT || value != OUTPUT)
This line should have a && instead of a ||. Small logic mistake that breaks this example. I'll make a merge request to fix this.

from arduinomodbusslave.

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.