node-modbus-serial icon indicating copy to clipboard operation
node-modbus-serial copied to clipboard

Allow server handler for getMultipleCoils

Open bruceceng opened this issue 4 years ago • 2 comments

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.

bruceceng avatar Jun 22 '21 20:06 bruceceng

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.

SystemParadox avatar Nov 07 '22 11:11 SystemParadox

Hi, thanks for the issue, can you make a pull request adding this options ?

yaacov avatar Nov 07 '22 16:11 yaacov