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

The result is an error. #42

Open
acabia opened this issue Jul 20, 2019 · 1 comment
Open

The result is an error. #42

acabia opened this issue Jul 20, 2019 · 1 comment

Comments

@acabia
Copy link

acabia commented Jul 20, 2019

I am doing a coding test using Arduino board.
Unwanted results occur during testing.
If you try to read data remotely after inserting m_Modbus.Ists value, an error occurs in multiples of 8.
I think that the Modbus.cpp file contains an error in the void Modbus :: readInputStatus () function.
please check.
di-error2
di error 1

Temporarily modifying and testing as below.

#if 0 while (numregs--) { i = (totregs - numregs) / 8; if (this->Ists(startreg)) bitSet(_frame[2+i], bitn); else bitClear(_frame[2+i], bitn); //increment the bit index bitn++; if (bitn == 8) bitn = 0; //increment the register startreg++; } #else do{ i = (totregs - numregs) / 8; if (this->Ists(startreg)) bitSet(_frame[2+i], bitn); else bitClear(_frame[2+i], bitn); //increment the bit index bitn++; if (bitn == 8) bitn = 0; //increment the register startreg++; } while (numregs--); #endif

di-ok

@ESP-O-MAT
Copy link

Related to this issue:
#35

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

No branches or pull requests

2 participants