plcpeople / mcprotocol

node.js implementation of the MC (MELSEC communication) protocol to exchange data with Mitsubishi FX programmable controllers.
MIT License
98 stars 40 forks source link

The value of "offset" is out of range. #12

Open sayyedabdulmajid opened 1 year ago

sayyedabdulmajid commented 1 year ago

angeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 1. Received 2 at boundsError (internal/buffer.js:49:9) at Uint8Array.readUInt8 (internal/buffer.js:213:5) at processMBWriteItem (/home/pi/Downloads/mcprotocol-master/mcprotocol.js:1358:27)

Problem Resolved by changing at line 1358 in MCprotocol.js file: 1358: writeResponse = theData.readUInt8(1);