Closed LogicNode closed 6 years ago
Yes this is what i am looking for,thanks a lot .. I've learned so much about Modbus RTU because of this issue.. thanks again for your efforts :)
Thank you for your effort! RTU wasn't really used much. You helped a lot in making this library better.
@Mohammed-OceanPLX I updated the v3.0.1_dev branch with a working set of tests and some fixes. Would you test it with your device? Thanks.
Sorry for the delay,, here is the output:
// note: register value in response was okay ( hex:1388 Dec: 5000) !
serialport:binding:auto-detect loading WindowsBinding +0ms
serialport:main opening path: COM6 +0ms
serialport:bindings open +0ms
serialport:main _read queueing _read for after open +2ms
serialport:main opened path: COM6 +84ms
opened
modbus-client issuing new read holding registers request +0ms
rtu-client-request-handler registrating new request +0ms
user-request creating new user request with timeout 5000 +0ms
client-request-handler flushing +0ms
client-request-handler flushing new request <Buffer 01 03 00 00 00 01 84 0a> +1ms
serialport:main _write 8 bytes of data +5ms
serialport:bindings write 8 bytes +92ms
serialport:main _read reading +1ms
serialport:bindings read +0ms
serialport:main binding.write write finished +1ms
client-request-handler request fully flushed, ( error: undefined ) undefined +4ms
serialport:main binding.read finished +35ms
modbus-client received data +42ms
rtu-response-handler receiving new data +0ms
rtu-response-handler buffer <Buffer 01> +1ms
rtu-response address 1 buffer <Buffer 01> +0ms
response-factory when NoSuchIndex Exception, the buffer does not contain a complete message +0ms
response-factory RangeError: Index out of range
response-factory at checkOffset (buffer.js:977:11)
response-factory at Buffer.readUInt8 (buffer.js:1015:5)
response-factory at Function.fromBuffer (F:\ocnplcx\nodeapps0\node_modules\jsmodbus\src\response\response-factory.js:19:23)
response-factory at Function.fromBuffer (F:\ocnplcx\nodeapps0\node_modules\jsmodbus\src\rtu-response.js:14:32)
response-factory at ModbusRTUClientResponseHandler.handleData (F:\ocnplcx\nodeapps0\node_modules\jsmodbus\src\rtu-client-response-handler.js:17:40)
response-factory at ModbusRTUClient._onData (F:\ocnplcx\nodeapps0\node_modules\jsmodbus\src\modbus-client.js:37:27)
response-factory at emitOne (events.js:121:20)
response-factory at SerialPort.emit (events.js:211:7)
response-factory at addChunk (_stream_readable.js:263:12)
response-factory at readableAddChunk (_stream_readable.js:250:11) +0ms
rtu-response-handler not enough data available to parse +1ms
{ '0': <Buffer 01> }
serialport:main _read reading +5ms
serialport:bindings read +41ms
serialport:main binding.read finished +1ms
modbus-client received data +6ms
rtu-response-handler receiving new data +4ms
rtu-response-handler buffer <Buffer 01 03 02 13 88 b5 12> +1ms
rtu-response address 1 buffer <Buffer 01 03 02 13 88 b5 12> +6ms
response-factory fc 3 payload <Buffer 03 02 13 88 b5 12> +6ms
rtu-response-handler crc 769 +1ms
rtu-response-handler reset buffer from 7 to 0 +4ms
rtu-response-handler not enough data available to parse +1ms
rtu-client-request-handler new response coming in +54ms
(node:7832) UnhandledPromiseRejectionWarning: TypeError: "value" argument is out of bounds
at checkInt (buffer.js:1185:11)
at Buffer.writeUInt8 (buffer.js:1233:5)
at F:\ocnplcx\nodeapps0\node_modules\jsmodbus\src\response\read-holding-registers.js:87:15
at Array.forEach (
Since this special issue is solved, i am gonna close it. I'll need to test v3.0.1 a bit more and restart the munin server for long time observations. Can take a while, i hope you are fine with checking out the v3.0.1_dev branch in the meantime. Thanks for you commitment.
Hello, I am having an issue trying to connect to salve device through Modbus RTU with ReadHoldingRegisters.js using the code below, I am getting the error: { '0': { err: 'Timeout', message: 'Request timed out' } } { '0': null }
Could you help please? thanks in advance!