GithubHelp home page GithubHelp logo

Comments (9)

yaacov avatar yaacov commented on June 14, 2024

Is there an error in the library?

maybe :-)

It will be nice to find it and fix it, if it exist, can you identify the problem and fix it, it will be nice:

Interesting code lines:

https://github.com/yaacov/ArduinoModbusSlave/blob/master/src/ModbusSlave.h#L33

https://github.com/yaacov/ArduinoModbusSlave/blob/master/src/ModbusSlave.h#L35

https://github.com/yaacov/ArduinoModbusSlave/blob/master/src/ModbusSlave.cpp#L163

https://github.com/yaacov/ArduinoModbusSlave/blob/master/src/ModbusSlave.cpp#L311

https://github.com/yaacov/ArduinoModbusSlave/blob/master/src/ModbusSlave.cpp#L337

from arduinomodbusslave.

g6pl avatar g6pl commented on June 14, 2024

Thank you for your response..
unfortunately, it's not my league ..
I can not do it;)

from arduinomodbusslave.

yaacov avatar yaacov commented on June 14, 2024

it's not my league ..

a - you can try :-)
b - I think the lib is ok ( from looking at the code, didn't try ... ), you can check again on your side, maybe you can see the problem in your code ?

from arduinomodbusslave.

g6pl avatar g6pl commented on June 14, 2024

My code:
`uint8_t writeMemory(uint8_t fc, uint16_t address, uint16_t length) {

uint16_t registerIndex;

for (int i = 0; i < length; i++) 
{
    array_writeMemory[i]=slave.readRegisterFromBuffer(i);  
}
    temperature1=array_writeMemory[0]/10;
    temperature2=array_writeMemory[1]/10;
    temperature3=array_writeMemory[2]/10;

return STATUS_OK;`

and i use to testing program QModbus : https://sourceforge.net/projects/qmodbus/files/latest/download

from arduinomodbusslave.

yaacov avatar yaacov commented on June 14, 2024

where in your code do you use the address ?

from arduinomodbusslave.

g6pl avatar g6pl commented on June 14, 2024

1
2
1.jpg is OK
2.jpg is not

from arduinomodbusslave.

g6pl avatar g6pl commented on June 14, 2024

If i use 0x06 write single register only is temperature1 ok in my code.
If i use 0x10 multiple register write temperature1 , 2 ,3 are OK

from arduinomodbusslave.

yaacov avatar yaacov commented on June 14, 2024

array_writeMemory[i]=slave.readRegisterFromBuffer(i);
should be:
array_writeMemory[i + address]=slave.readRegisterFromBuffer(i); ?

from arduinomodbusslave.

g6pl avatar g6pl commented on June 14, 2024

By removing parts of the program that were not necessary for me, I did not know that the address was needed. You are great! Thank you again for your help. You did a great job!!!

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.