Skip to content

Conversation

@richardash1981
Copy link

Support for ModBus file registers, part 1.

This implements ModBus master support for reading and writing a single contiguous range of values in a file register (the protocol supports multiple ranges of values in a single requests, but this implementation does not).
This is the first (and hopefully not controversial) part of the changes, which extends the API but does not make any changes / breakages to it.

The Modbus Application Protocol V1.1b includes optional opcodes to read
(6.14) and write (6.15) "files", which are fixed-format random-access
storage. This is more efficient than traditional registers where a large
amount of contiguous data has to be transferred.
Created documentation in similar style to other documentation.
@karlp
Copy link
Contributor

karlp commented Jun 22, 2020

There's some whitespace issues, and I don't know whether code style allows teh c++ comments, but this otherwise looks fine to me at least.

@richardash1981
Copy link
Author

Good point. I didn't find a code style document (and I'm a C++ programmer really ...) The implementation code isn't mine (it was produced by a contractor colleague a couple of years ago) but I wrote the documentation for it because there wasn't any.
I now realise it bears more than some resemblance to #407 (does the same thing but isn't the same code).
It's even more like the (also unmerged) #449, in fact that is the same code (mek-x was the contractor who wrote the support for EA). I didn't get the documentation that's in that fork however, which is why I wrote the commits here. Need to do some closing up of these two lines.

@richardash1981
Copy link
Author

Closing this in favour of #548 which has the same stuff and some more.

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

Successfully merging this pull request may close these issues.

2 participants