node-modbus-serial
node-modbus-serial copied to clipboard
Allow server handler for getMultipleCoils
For registers it is possible to provide a handler that is invoked if multiple registers are read from a single command. However for coils, a single command will invoke the getCoil handler multiple times (if length > 1). There may be cases where this behavior is undesirable. If a getMultipleCoils handler is provided, it should be called rather than the getCoil handler.
Also for getMultipleDiscreteInputs.
We've run into this when trying to write unit tests to ensure that concurrency limits are not violated, but since these are missing from the server API we can't tell the difference between a single request to read multiple coils/discreteInputs or multiple concurrent requests.
Hi, thanks for the issue, can you make a pull request adding this options ?