-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Users functions #522
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
base: master
Are you sure you want to change the base?
Users functions #522
Conversation
|
I believe #140 would be a better solution to this problem, (and also solves many more) |
|
Maybe so, but one does not interfere with the other. And it can be implemented in the code base at the same time. |
|
PS: Callbacks are convenient to use when you need to do something non-trivial. In your link #140 I see an implicit link to the size of the data. In my opinion, my solution is simple, convenient to use and very intelligible (solving a specific problem). |
|
mazi thanx! |
|
I would need this improvement to implement user defined functions. What is missing for merging it ? |
|
I've been asking the same question for a few years now.... ( |
Add new API function
int modbus_send_generic_request(modbus_t *ctx, const uint8_t *raw_req, int raw_req_length, int wanted_resp_data_length);to enable the implementation of user-defined modbus functions (by standard in the range 65...72 and 100...110) with a predetermined number of requested bytes.
wanted_resp_data_length is number of data bytes between the function code and the checksum
(address, function, data[wanted_resp_data_length], crc).