Conversation
|
There was already a pull-request #407 trying to add file-support. Not integrated though. Have you seen it? |
|
@pboettch I have seen it, also looks fine too. I've pushed my changes since those were left after implementing this functionality to one project I was doing, so I though I could share them. Personally I don't know which solution is better/cleaner. |
pboettch
left a comment
There was a problem hiding this comment.
Yours looks cleaner to my eyes. I will integrate in the my fork of this project, I might need it in the future.
(my fork contains a more sophisticated way of implementing a multi-client server with this library)
doc/modbus_write_file_record.txt
Outdated
|
|
||
| SYNOPSIS | ||
| -------- | ||
| *int modbus_write_file_record(modbus_t *'ctx', int 'addr', int 'sub_addr', int 'nb', uint16_t *'src');* |
There was a problem hiding this comment.
in the code, it is const uint16_t *src.
|
I'm currently implementing the reply-function in my fork and took a look at the MODBUS-spec and figured out that the FILE-operation allow requesting multiple sub-requests for 0x14 and 0x15. Either I overlooked it or you didn't implement it in your reply-implementation. Could you explain why? Could it be, because libmodbus itself does not allow doing multiple sub-requests? |
|
To avoid duplicated work, I implemented sub-request handling for file-read/write on a local repo, I will publish when the reply is working as well. |
|
@pboettch that's correct. This implementation is working only with single sub-request due to simplicity reasons. |
Add support for Read File Record (0x14) and Write File Record (0x15) functions.
Supports single file read/write.