I started with a simple test program but I am not sure what all the steps should be.
Do you really need console application? There are several GUI modbus demos in Examples directory. It would be much easier if you examine them and try to adapt them to your needs. You can even use some of the mentioned MODBUS slave simulators for a quick startup convenience. From your code and guessed expectations I think that one of the 2 mentioned libraries would be more appropriate.
Maybe we should integrate each others code for my suggested patch (there is a willingness to accept it for sysutils helpers from devel's)
Maybe we can work together and use some of your code for the helpers? My code is more basic, bare essentials, and your code has more features.
Feel free to use whatever you want from my code. If discussion is needed, then PM me or open a new thread. On the other hand I use almost every features from BitHelpers so if merge is not feature rich (especially custom format data printing) then I can simply continue using original BitHelpers. Not a problem, as long as there are no conflicts.
If you remember, we discussed adding BitHelpers to sysutils, and at first I was convinced that it was the way to go, but because this issue could not be fixed:
MyWord.Byte[1].Bit[7] := true; // %0000000100000010 MyWord equals 258 (Beware!!! This DOES NOT set a bit in MyWord !!!)
I felt that it did not belong there - having something that potentially could lead to bugs in user code. I know that documenting such behavior should be enough, but many people do not read every bit of docs and besides compiler lets them use it in such a way so they might expect different from what can be. I would satisfy even with a compiler warning or error in such case, but could not find a way to do it. That's why I wanted to simply donate BitHelpers unit to FPC (and documenting it including mentioned behavior), but I was late for 3.2 so I was initially hoping to do it for 3.4. Anyway, as already said if you come up with something else I am quite fine with that, too. Merge is fine, but leaving our code separate is also fine.