plcpeople/nodeS7

Support more than 8192 byte data size

lpc921 opened this issue · 0 comments

Hi, thanks for the great library. I found an issue while trying to read large amounts of data from the PLC. Data after ~8192 has quality "BAD undefined".

After some digging I found the buffer size is set to 8 kB:

nodeS7/nodeS7.js

Lines 2745 to 2752 in 44a1b5e

// This is where the data can go that arrives in the packet, before calculating the value.
this.byteBuffer = Buffer.alloc(8192);
this.writeBuffer = Buffer.alloc(8192);
// We use the "quality buffer" to keep track of whether or not the requests were successful.
// Otherwise, it is too easy to lose track of arrays that may only be partially complete.
this.qualityBuffer = Buffer.alloc(8192);
this.writeQualityBuffer = Buffer.alloc(8192);

nodeS7/nodeS7.js

Line 1044 in 44a1b5e

dataBuffer = Buffer.alloc(8192);

Is there any reason to limit the size of buffers to 8 kB? I think most S7 PLCs support 64 kB DBs.