Skip to content

Commit ae839ad

Browse files
committed
exception crc check fixed
1 parent 886669b commit ae839ad

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/response/exception.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ export default class ExceptionResponseBody extends ModbusResponseBody {
6464

6565
public createPayload () {
6666
const payload = Buffer.alloc(2)
67-
payload.writeUInt8(this._fc, 0)
67+
// This is a exception Response
68+
// Add 0x80 for compatibility (crc check)
69+
payload.writeUInt8(this._fc + 0x80, 0)
6870
payload.writeUInt8(this._code, 1)
6971
return payload
7072
}

0 commit comments

Comments
 (0)