morkai / h5.modbus

Implementation of the MODBUS IP/ASCII/RTU master and slave over TCP/UDP/Serial for Node.js.
https://miracle.systems/p/h5.modbus
MIT License
28 stars 21 forks source link

Cheking ExceptionResponse #8

Closed goranach closed 8 years ago

goranach commented 8 years ago

Could you explain how chek the response for exception. There are isException() in ExceptionResponse, but not this in ReadHoldingRegistersResponse. I chek existing data. Thank you.

morkai commented 8 years ago

There's Message -> Response -> ReadHoldingRegistersResponse/ExceptionResponse.

The isException() is defined in Response and always returns false. Then it's overridden in ExceptionResponse to return true.

goranach commented 8 years ago

Sorry, I did not notice. New version is very stable and interesting to reflection.