plcpeople / nodepccc

Library for node.js to communicate with some Allen-Bradley programmable controllers (PLCs)
MIT License
81 stars 24 forks source link

[BUG] Overflow(?) with lost connection #10

Closed meron1122 closed 5 years ago

meron1122 commented 8 years ago

I send lifeBit to PLC like this

   setInterval(() => {
                if (!this.handleLifeBit) {
                    conn.readAllItems((anythingBad, values) => {
                        var val = values[this.config.lifeBit.address];
                        val = val == 1 ? 0 : 1;

                        conn.writeItems(this.config.lifeBit.address,
                            [val], this.valuesWritten);
                    });

                }
            }, this.config.lifeBit.interval);

Read int, and write negated.

If I "cut off" ethernet, after some time,(I think overflow queue?) libary throws uncaught Exception. Error: TypeError: Cannot read property 'length' of undefined

Log:

[1343,227455893] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1343,328989652] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1343,431009174] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1343,532745026] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1343,634546421] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1343,736446207] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1343,837179769] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1343,937974933] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,39941167] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,141726236] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,229407891] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,244059955] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,329732601] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,345436256] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,431090838] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,445760237] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,532379732] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,547042155] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,632682681] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,648394458] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,734005361] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,749676168] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,835405610] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,851181524] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,936296112] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1344,951221660] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,37029087] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,53190726] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,138250324] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,153368022] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,229440609] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,239667824] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,255820821] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,331919593] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,342044617] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,357053979] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,433081223] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,443200155] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,458245647] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,534241498] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,544291973] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,558335588] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,634341956] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,645448449] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,659436048] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,736663097] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,747784427] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,761786082] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,838940561] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,851718515] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,898799574] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,941122674] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1345,953901424] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,551835] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,42258240] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,54921212] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,102567358] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,142198321] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,155824334] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,203453821] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,232127740] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,242759727] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,257423019] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,304062758] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,332761456] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,344376685] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,357995098] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,405567112] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,433200940] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,444811171] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,459454212] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,506073127] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,533804150] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,546419331] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,560073977] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,606757914] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,635438183] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,647068197] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,660715971] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,708312452] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,726468965 192.168.5.200] READ TIMEOUT on sequence number 2
[1346,728563201 192.168.5.200] Preparing to WRITE N7:0
[1346,735342447] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,748113389] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,761738205] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,809353011] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,836023694] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,849887201] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,874889492] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,910859952] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,937669092] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,951303608] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1346,975954217] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,12636907] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,39281956] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,51922974] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,77549589] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,114159969] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,139785282] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,153460977] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,178092272] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,214761062] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,232386697] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,241206308] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,253654967] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,279373102] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,316028669] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,332659817] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,342266407] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,354941472] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,381366675] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,417051026] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,433699926] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,443345300] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,456965812] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,482607264] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,517233251] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,534885332] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,544517899] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,558128312] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,582784959] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,618430161] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,636066729] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,644733026] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,659377594] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,684015865] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,719661171] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,737341677] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,745987566] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,760615371] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,785250467] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,820860633] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,838523751] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,849278403] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,873808130] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,886758796] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,922589952] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,938235065] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,951906559] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,979964113] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1347,988950064] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,23624716] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,39291486] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,52955171] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,81573664] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,89188738] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,124771460] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,140416157] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,154091555] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,181736435] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,190387593] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,226044135] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,232688668] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,240318319] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,254925579] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,283568227] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,290221662] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,326835730] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,334475325] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,341072536] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,355677193] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,384290896] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,390917104] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,428510147] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,435162697] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,441781514] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,457419286] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,485010493] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,492615728] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,528211257] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,535845958] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,543471860] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,558114885] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,585726707] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,593426221] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,629036118] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,636659470] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,644282145] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,658910384] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,687512530] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,694176794] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,729780392] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,738495739] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,745112577] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,759746595] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,788475088] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,795147994] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,830754403] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,839390203] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,847391870] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,874639329] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,889610692] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,896480396] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,932162078] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,939815321] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,949481178] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,976124053] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,990765429] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1348,997402786] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,32991381] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,41621257] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,50272009] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,76908950] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,92496400] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,98140621] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,133748218] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,143404965] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,151020256] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,178592755] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,193220075] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,198849928] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,234445759] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,236067668] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,243683324] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,252295084] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,279899391] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,294620209] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,300269480] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,334872644] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,337479984] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,345126303] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,352773976] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,381372043] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,396044082] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,400671168] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,436284544] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,437924829] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,446526750] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,454137252] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,481763580] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,497342024] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,501948702] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,537516058] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,539175501] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,546760338] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,555367881] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,583518602] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,598248844] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,602900970] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,638479153] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,640117253] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,647765862] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,657367686] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,684998804] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,736688623] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,742112737] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,742664306] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,742983325] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,749443264] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,758051172] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,785672398] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,838306157] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,842945841] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,843331705] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,844849234] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,854093671] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,876712047] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,886501441] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,938978936] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,944413104] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,944619988] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,945963901] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,955340267] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,976735014] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1349,987112899] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,39590595] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,45253408] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,45608974] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,47174504] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,55807671] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,77401337] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,88139212] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,139756627] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,146552096] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,146834154] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,148414261] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,157035037] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,178652025] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,189242521] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,234942083] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,240625928] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,247193273] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,247492251] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,249170125] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,257786684] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,279389721] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,290101046] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,336814257] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,341408083] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,348006976] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,348266648] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,350903196] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,359507313] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,380163337] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,390793346] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,438450394] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,442069251] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,448707553] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,448976127] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,452619556] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,460221374] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,480829660] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,492473421] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,539077932] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,542761394] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,548350700] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,550081310] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,553753528] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,560376785] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,581982060] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,593634880] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,640294886] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,642902645] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,649499404] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,651157184] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,653812838] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,661409345] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,682990985] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,694631154] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,741266328] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,743887207] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,750490681] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,752113164] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,754796358] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,762384067] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,783952328] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,795627273] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,842232929] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,844855577] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,851656669] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,853737275] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,859123497] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,863467697] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,981199887] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,981932052] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,982082399] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,982162415] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,982252686] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,982321560] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,982386531] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1350,982451865] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,82901115] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,83098369] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,83188171] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,83255692] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,83341278] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,83407810] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,83474186] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,83539989] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,184936565] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,185108049] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,185202121] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,185268288] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,185332425] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,185417022] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,185483085] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,185548524] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[1351,232430932 192.168.5.200] WRITE TIMEOUT on sequence number 4735

It be very good if libary throw message for example:

nodepcc.on('lostConnection',() => {
});

Best Regards, and thanks again for libary!

plcpeople commented 8 years ago

What line of code caused the error? This may be another bug that is not necessarily an overflow.

I think a lot could be done to improve the library by emitting events. But in this case I don't think we have received a TCP disconnect from node. When you disconnect the PLC, are you turning it off but leaving your computer connected to the network? If so, the TCP disconnect is difficult to detect, but "anythingBad" will be true due to the timeout error.

In programs where I have used this routine, I have always waited until previous reads/writes return before calling another. Normally this is in milliseconds, but when you cut communication this can take a couple of seconds.

I will try to test this as well, maybe this weekend.

plcpeople commented 5 years ago

I am closing this as improvements have been made on handling errors since this bug was reported. If you are still seeing this issue please re-open.