A quick description of some of the cool features included in Modbus4J
- ModbusFactory for easily creating master and slave instances
- ProcessImageListener: a callback mechanism that makes the handling of slave write events very simple
- Pluggable exception listeners: no more setting debug=true or dumping errors to System.out. Handle exceptions like you want in client code.
- Controllable slaves: as i recall the jamod slave implementation starts on VM startup and only stops when the VM is killed. In Modbus4J they are completely controllable.
- Node scanning: you can ask the Modbus master to scan for probable active nodes either as a blocking thread or a progressive (and cancel-able) task.
- Simple polling with batch reads that 1) are very intuitive to create, 2) have their responses automatically deconstructed and referenced according to client code, and 3) automatically optimize by making a mimimal number of contiguous requests.
- Simple write commands that will attempt to use optimal requests (such as WriteMaskRegisterRequest) but will failover to more typical requests if the node appears to not support. (This result is also automatically remembered so that it doesn't try the unsupported request again.)