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

read data from function ‫‪0x04‬‬ #2

Open
SaeedNowroozi opened this issue May 28, 2024 · 3 comments
Open

read data from function ‫‪0x04‬‬ #2

SaeedNowroozi opened this issue May 28, 2024 · 3 comments

Comments

@SaeedNowroozi
Copy link

I want to read data from address 1, function 4, address reg ‫‪0x0000‬‬, 1 number, but not any action.
float txf[8];
mmodbus_readInputRegisters32f(1, 0, 1, txf);

@sadra-fazeli
Copy link

sadra-fazeli commented Aug 15, 2024

Hello, I have the same problem. i used this function: bool mb_status = mmodbus_readHoldingRegisters16i(1, 0, 5, modbus_data); i saw mmodbus.rxBuf[] value on debuger. returned data from slave is store on mmodbus.rxBuf[] but i cant use it any where,. my modbus_data[32] all index are zero and also mb_status is false so what do we do?

@nimaltd
Copy link
Owner

nimaltd commented Aug 16, 2024

I don't have any device to test it. but as I can remember, I tested it before. Please debug step by step and see what is happening in the function and tell me. thanks.

@sadra-fazeli
Copy link

I don't have any device to test it. but as I can remember, I tested it before. Please debug step by step and see what is happening in the function and tell me. thanks.

i forget to say my mcu is G030C8T6. i do some change. i can use mmodbus.rxBuf[] members only on library, for example i wrote a function to combine mmodbus.rxBuf[4] and mmodbus.rxBuf[5] and return data But when i define my array and use function in while loop all member of it is are zero.

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

3 participants