Tuesday, March 10, 2020

PLC4X and MODBUS

I found an excellent resource to solve my MODBUS connectivity needs recently: PLC4x
The one thing that made the experience better than normal was the documentation - which was excellent.

However, weirdly enough the only problem I had using the library was also related to the documentation. If you're trying to follow the current documentation and failing to read MODBUS values 

The documentation specifies the addressing scheme as follows:




However, I kept having PlcFieldInvalidExceptions with the above format.
Eventually I had to go through the source to find that the patterns in use are actually like the following:
Holding Registers for Read -  readholdingregisters:{start-number}

No comments: