Giter Club home page Giter Club logo

Comments (42)

youngkzy avatar youngkzy commented on July 18, 2024 1

Something curious happened. I had to delete the PCCC read and write nodes and the configuration node in order to keep from getting an error. When I put them back in order to do the debug today. I put in the configuration only with N7:0... then I added N7:0/0 when it would not read or write, however, it did say "online".
I removed everything again and set up the configuration with N7:0/0-15 and then also N7:0 word reference addresses. Now it's working... (?) well, it connected and is counting.

[{"id":"7d21a8eb.0d0578","type":"function","z":"46d5e03a.f74e1","name":"counter","func":"var count = msg.payload;\nif (count>32766)\n{\n count=0;\n}\ncount=count+1;\nmsg.payload=count;\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":1140,"wires":[["b7b90936.ad3588","bbdfd60a.7b0b58"]]},{"id":"bbdfd60a.7b0b58","type":"pccc out","z":"46d5e03a.f74e1","endpoint":"88afadd7.3a97d","variable":"N7:0","name":"","x":890,"y":1140,"wires":[]},{"id":"92772800.ebb978","type":"pccc in","z":"46d5e03a.f74e1","endpoint":"88afadd7.3a97d","mode":"single","variable":"N7:0","diff":true,"name":"","x":150,"y":1140,"wires":[["7d21a8eb.0d0578"]]},{"id":"88afadd7.3a97d","type":"pccc endpoint","z":"","address":"192.168.254.220","port":"44818","userouting":false,"routing":"0x01,0x00,0x01,0x00","cycletime":"500","timeout":"1500","name":"","vartable":[{"addr":"N7:0/0","name":"N7:0/0"},{"addr":"N7:0/1","name":"N7:0/1"},{"addr":"N7:0/2","name":"N7:0/2"},{"addr":"N7:0/3","name":"N7:0/3"},{"addr":"N7:0/4","name":"N7:0/4"},{"addr":"N7:0/5","name":"N7:0/5"},{"addr":"N7:0/6","name":"N7:0/6"},{"addr":"N7:0/7","name":"N7:0/7"},{"addr":"N7:0/8","name":"N7:0/8"},{"addr":"N7:0/9","name":"N7:0/9"},{"addr":"N7:0/10","name":"N7:0/10"},{"addr":"N7:0/11","name":"N7:0/11"},{"addr":"N7:0/12","name":"N7:0/12"},{"addr":"N7:0/13","name":"N7:0/13"},{"addr":"N7:0/14","name":"N7:0/14"},{"addr":"N7:0/15","name":"N7:0/15"},{"addr":"N7:0","name":"N7:0"}]}]

from node-red-contrib-pccc.

gfcittolin avatar gfcittolin commented on July 18, 2024

Hello,

I'm not aware of this problem. This node has been developed and published in a partnership with another guy that had the PLC, I never had one myself, so I can't confirm or test this behavior myself.

For us to better understand the problem, could you please run your node-red in verbose mode (with the -v flag on the command line)? There will be a lot of messages on the console, please simulate the issue and post these logs here, so we can understand what's exactly happening under the hood.

Beside that, could you also please post your flow? Even though I don't have a PLC here, I can try to use SoftLogix and check if it also happens with a SoftPLC.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

Verbose output to Terminal.

[950881,62445486 192.168.254.220] Preparing to WRITE N7:0
[950881,62550831 192.168.254.220] Clearing write PacketTimeouts
[950881,62599539] WPAL is 1
[950881,62649380] AddrInfo WriteBuffer[0] is 246
[950881,62692802] The returned buffer length is 8
[950881,62835905 192.168.254.220] Sending Write Packet With Sequence Number 1058
[950881,72724753] <Buffer 6f 00 1f 00 f8 e7 f1 46 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 0f 00 cb 00 00 00 07 00 00 01 02 03 ... >
[950881,73060422] onResponse called with length 55
[950881,73295655] Valid EIP Data Response Received
[950881,73519561] Received 15 bytes of CIP-data from PLC.
[950881,73743466] Received 11 bytes of PCCC-data from PLC.
[950881,73968882] <Buffer 07 00 00 01 02 03 04 4f 00 22 04>
[950881,74100281] On Response - Sequence 1058
[950881,74192033] Time is 0 seconds and 11.5 ms.
[950881,74286428] N7:0 write completed with quality OK
[950881,535623639 192.168.254.220] Reading All Items (readAllItems was called)
[950881,537177385 192.168.254.220] Calling SRP from RAI
[950881,537686742 192.168.254.220] SendReadPacket called
[950881,538186281] The A2 Returned Buffer is:
[950881,538663921] <Buffer a2 02 07 89 00 00>
[950881,539171013] The returned buffer length is 6
[950881,539699249] The PCCC Encapsulation Header is:
[950881,540147060] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[950881,540579390] The Returned buffer is:
[950881,540883720] <Buffer a2 02 07 89 00 00>
[950881,541444428] Sending Read Packet SEQ 2
[950881,552819435] <Buffer 6f 00 21 00 f8 e7 f1 46 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[950881,553464721] onResponse called with length 57
[950881,553937075] Valid EIP Data Response Received
[950881,554416981] Received 17 bytes of CIP-data from PLC.
[950881,554891977] Received 13 bytes of PCCC-data from PLC.
[950881,555359045] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 f6 33>
[950881,555861983] On Response - Sequence 2
[950881,556330561] Received Response to Sequence 0
[950881,556777240 192.168.254.220] ReadResponse called
[950881,557142738] Byte Buffer is:
[950881,557418750] <Buffer f6 33>
[950881,557728744 192.168.254.220] Read Time is 0 seconds and 19.6 ms.
[950881,558031941 192.168.254.220] Every packet done sending
[950881,558308708] Item Datatype (single value) is X and BO is -1
[950881,558677605 192.168.254.220] Address N7:0/0 has value false and quality OK
[950881,558959281] Item Datatype (single value) is INT and BO is -1
[950881,559222077 192.168.254.220] Address N7:0 has value 13302 and quality OK
[950881,559459953] Item Datatype (single value) is X and BO is -1
[950881,559692165 192.168.254.220] Address N7:0/1 has value true and quality OK
[950881,559922112] Item Datatype (single value) is X and BO is -1
[950881,560135068 192.168.254.220] Address N7:0/2 has value true and quality OK
[950881,560202655] Item Datatype (single value) is X and BO is -1
[950881,560244566 192.168.254.220] Address N7:0/3 has value false and quality OK
[950881,560286478] Item Datatype (single value) is X and BO is -1
[950881,560328012 192.168.254.220] Address N7:0/4 has value true and quality OK
[950881,560369546] Item Datatype (single value) is X and BO is -1
[950881,560410324 192.168.254.220] Address N7:0/5 has value true and quality OK
[950881,560452614] Item Datatype (single value) is X and BO is -1
[950881,560493392 192.168.254.220] Address N7:0/6 has value true and quality OK
[950881,560534926] Item Datatype (single value) is X and BO is -1
[950881,560576838 192.168.254.220] Address N7:0/7 has value true and quality OK
[950881,560618372] Item Datatype (single value) is X and BO is -1
[950881,560659528 192.168.254.220] Address N7:0/8 has value true and quality OK
[950881,560701817] Item Datatype (single value) is X and BO is -1
[950881,560742973 192.168.254.220] Address N7:0/9 has value true and quality OK
[950881,560785262] Item Datatype (single value) is X and BO is -1
[950881,560827174 192.168.254.220] Address N7:0/10 has value false and quality OK
[950881,560868330] Item Datatype (single value) is X and BO is -1
[950881,560910242 192.168.254.220] Address N7:0/11 has value false and quality OK
[950881,560952153] Item Datatype (single value) is X and BO is -1
[950881,560993310 192.168.254.220] Address N7:0/12 has value true and quality OK
[950881,561035221] Item Datatype (single value) is X and BO is -1
[950881,561077133 192.168.254.220] Address N7:0/13 has value true and quality OK
[950881,561119044] Item Datatype (single value) is X and BO is -1
[950881,561159445 192.168.254.220] Address N7:0/14 has value false and quality OK
[950881,561202112] Item Datatype (single value) is X and BO is -1
[950881,561242891 192.168.254.220] Address N7:0/15 has value false and quality OK
[950881,561284425 192.168.254.220] We are calling back our readDoneCallback.
[950881,561507197 192.168.254.220] Preparing to WRITE N7:0
[950881,561609899 192.168.254.220] Clearing write PacketTimeouts
[950881,561657097] WPAL is 1
[950881,561707693] AddrInfo WriteBuffer[0] is 247
[950881,561751870] The returned buffer length is 8
[950881,561904413 192.168.254.220] Sending Write Packet With Sequence Number 1059
[950881,573122346] <Buffer 6f 00 1f 00 f8 e7 f1 46 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 0f 00 cb 00 00 00 07 00 00 01 02 03 ... >
[950881,573812941] onResponse called with length 55
[950881,574319655] Valid EIP Data Response Received
[950881,574788988] Received 15 bytes of CIP-data from PLC.
[950881,575319867] Received 11 bytes of PCCC-data from PLC.
[950881,575727655] <Buffer 07 00 00 01 02 03 04 4f 00 23 04>
[950881,576233991] On Response - Sequence 1059
[950881,576739950] Time is 0 seconds and 15 ms.
[950881,577234203] N7:0 write completed with quality OK
[950882,36911190 192.168.254.220] Reading All Items (readAllItems was called)
[950882,38517798 192.168.254.220] Calling SRP from RAI
[950882,39047921 192.168.254.220] SendReadPacket called
[950882,39555013] The A2 Returned Buffer is:
[950882,40019815] <Buffer a2 02 07 89 00 00>
[950882,40531815] The returned buffer length is 6
[950882,41000771] The PCCC Encapsulation Header is:
[950882,41465573] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[950882,41908475] The Returned buffer is:
[950882,42204121] <Buffer a2 02 07 89 00 00>
[950882,42738021] Sending Read Packet SEQ 2
[950882,52966692] <Buffer 6f 00 21 00 f8 e7 f1 46 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[950882,53924992] onResponse called with length 57
[950882,54415848] Valid EIP Data Response Received
[950882,54890089] Received 17 bytes of CIP-data from PLC.
[950882,55367730] Received 13 bytes of PCCC-data from PLC.
[950882,55841594] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 f7 33>
[950882,56357369] On Response - Sequence 2
[950882,56805936] Received Response to Sequence 0
[950882,57200130 192.168.254.220] ReadResponse called
[950882,57554679] Byte Buffer is:
[950882,57838620] <Buffer f7 33>
[950882,58131245 192.168.254.220] Read Time is 0 seconds and 18.6 ms.
[950882,58406879 192.168.254.220] Every packet done sending
[950882,58665900] Item Datatype (single value) is X and BO is -1
[950882,58908307 192.168.254.220] Address N7:0/0 has value true and quality OK
[950882,59146561] Item Datatype (single value) is INT and BO is -1
[950882,59308165 192.168.254.220] Address N7:0 has value 13303 and quality OK
[950882,59461463] Item Datatype (single value) is X and BO is -1
[950882,59631375 192.168.254.220] Address N7:0/1 has value true and quality OK
[950882,59683103] Item Datatype (single value) is X and BO is -1
[950882,59731056 192.168.254.220] Address N7:0/2 has value true and quality OK
[950882,59780519] Item Datatype (single value) is X and BO is -1
[950882,59832248 192.168.254.220] Address N7:0/3 has value false and quality OK
[950882,59877180] Item Datatype (single value) is X and BO is -1
[950882,59919847 192.168.254.220] Address N7:0/4 has value true and quality OK
[950882,59963646] Item Datatype (single value) is X and BO is -1
[950882,60005935 192.168.254.220] Address N7:0/5 has value true and quality OK
[950882,60049735] Item Datatype (single value) is X and BO is -1
[950882,60093156 192.168.254.220] Address N7:0/6 has value true and quality OK
[950882,60136578] Item Datatype (single value) is X and BO is -1
[950882,60178112 192.168.254.220] Address N7:0/7 has value true and quality OK
[950882,60222289] Item Datatype (single value) is X and BO is -1
[950882,60264578 192.168.254.220] Address N7:0/8 has value true and quality OK
[950882,60306867] Item Datatype (single value) is X and BO is -1
[950882,60349911 192.168.254.220] Address N7:0/9 has value true and quality OK
[950882,60393333] Item Datatype (single value) is X and BO is -1
[950882,60436000 192.168.254.220] Address N7:0/10 has value false and quality OK
[950882,60479422] Item Datatype (single value) is X and BO is -1
[950882,60521711 192.168.254.220] Address N7:0/11 has value false and quality OK
[950882,60564377] Item Datatype (single value) is X and BO is -1
[950882,60607422 192.168.254.220] Address N7:0/12 has value true and quality OK
[950882,60650466] Item Datatype (single value) is X and BO is -1
[950882,60692755 192.168.254.220] Address N7:0/13 has value true and quality OK
[950882,60736177] Item Datatype (single value) is X and BO is -1
[950882,60778843 192.168.254.220] Address N7:0/14 has value false and quality OK
[950882,60821888] Item Datatype (single value) is X and BO is -1
[950882,60864932 192.168.254.220] Address N7:0/15 has value false and quality OK
[950882,60907976 192.168.254.220] We are calling back our readDoneCallback.
[950882,61119799 192.168.254.220] Preparing to WRITE N7:0
[950882,61224389 192.168.254.220] Clearing write PacketTimeouts
[950882,61278383] WPAL is 1
[950882,61330489] AddrInfo WriteBuffer[0] is 248
[950882,61375044] The returned buffer length is 8
[950882,61562324 192.168.254.220] Sending Write Packet With Sequence Number 1060
[950882,536746565 192.168.254.220] Reading All Items (readAllItems was called)
[950882,538086600] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950882,647644762 192.168.254.220] Reading All Items (readAllItems was called)
[950882,648248892] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950882,755634075 192.168.254.220] Reading All Items (readAllItems was called)
[950882,757055668] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950882,864935860 192.168.254.220] Reading All Items (readAllItems was called)
[950882,866104096] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950882,974385656 192.168.254.220] Reading All Items (readAllItems was called)
[950882,976087037] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950883,83768999 192.168.254.220] Reading All Items (readAllItems was called)
[950883,85210603] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950883,193134972 192.168.254.220] Reading All Items (readAllItems was called)
[950883,194573933] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950883,302520580 192.168.254.220] Reading All Items (readAllItems was called)
[950883,304007494] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950883,411936016 192.168.254.220] Reading All Items (readAllItems was called)
[950883,413138612] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950883,521377506 192.168.254.220] Reading All Items (readAllItems was called)
[950883,522847429] Waiting to read for all R/W operations to complete.  Will re-trigger readAllItems in 100ms.
[950883,568866252 192.168.254.220] PacketTimeout called with type write and seq 1060
[950883,569532683 192.168.254.220] WRITE TIMEOUT on sequence number 1060
[950883,569975963] No communication to PLC.
[950883,570675998] Stopping Processing Write Response Packet due to unrecoverable packet error
[950883,571131361] Time is 1 seconds and 509.8 ms.
[950883,571586723] N7:0 write completed with quality OK
[950883,630567904 192.168.254.220] Reading All Items (readAllItems was called)
[950883,631893214 192.168.254.220] Calling SRP from RAI
[950883,632341025 192.168.254.220] SendReadPacket called
[950883,632791857] The A2 Returned Buffer is:
[950883,633209461] <Buffer a2 02 07 89 00 00>
[950883,633673886] The returned buffer length is 6
[950883,634099797] The PCCC Encapsulation Header is:
[950883,634473980] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[950883,634793414] The Returned buffer is:
[950883,635045260] <Buffer a2 02 07 89 00 00>
[950883,635669779] Sending Read Packet SEQ 2
[950885,140980457 192.168.254.220] PacketTimeout called with type read and seq 2
[950885,141381448 192.168.254.220] READ TIMEOUT on sequence number 2
[950885,141811890 192.168.254.220] ReadResponse called
[950885,142121129] Timeout error - zero length packet
[950885,142276315 192.168.254.220] Read Time is 1 seconds and 509.5 ms.
[950885,142493802 192.168.254.220] Every packet done sending
[950885,142882332 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[950885,143153436 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[950885,143350155 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[950885,143531017 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[950885,143631453 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[950885,143741329 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[950885,143817223 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[950885,143865554 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[950885,143917282 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[950885,143964857 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[950885,144011300 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[950885,144060385 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[950885,144107205 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[950885,144155536 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[950885,144202733 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[950885,144250686 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[950885,144298639 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[950885,144345837 192.168.254.220] We are calling back our readDoneCallback.
[950885,144392279 192.168.254.220] Reading All Items (readAllItems was called)
[950885,144440232 192.168.254.220] Calling SRP from RAI
[950885,144483654 192.168.254.220] SendReadPacket called
[950885,144534250] The A2 Returned Buffer is:
[950885,144578427] <Buffer a2 02 07 89 00 00>
[950885,144635064] The returned buffer length is 6
[950885,144678108] The PCCC Encapsulation Header is:
[950885,144721152] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[950885,144769105] The Returned buffer is:
[950885,144811772] <Buffer a2 02 07 89 00 00>
[950885,145000940] Sending Read Packet SEQ 2
30 Jul 16:42:36 - [error] [pccc endpoint:PLC] Failure (Bad values)
[950886,644653565 192.168.254.220] PacketTimeout called with type read and seq 2
[950886,645867866 192.168.254.220] READ TIMEOUT on sequence number 2
[950886,646174839 192.168.254.220] ReadResponse called
[950886,646521081] Timeout error - zero length packet
[950886,646664939 192.168.254.220] Read Time is 1 seconds and 502.1 ms.
[950886,646799736 192.168.254.220] Every packet done sending
[950886,646975689 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[950886,647128231 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[950886,647229423 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[950886,647297388 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[950886,647365730 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[950886,647411417 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[950886,647456349 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[950886,647501659 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[950886,647545458 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[950886,647604361 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[950886,647653069 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[950886,647698756 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[950886,647744444 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[950886,647788621 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[950886,647832798 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[950886,647877352 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[950886,647922284 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[950886,647964951 192.168.254.220] We are calling back our readDoneCallback.
[950886,648011016 192.168.254.220] Reading All Items (readAllItems was called)
[950886,648056703 192.168.254.220] Calling SRP from RAI
[950886,648098992 192.168.254.220] SendReadPacket called
[950886,648147323] The A2 Returned Buffer is:
[950886,648188857] <Buffer a2 02 07 89 00 00>
[950886,648243983] The returned buffer length is 6
[950886,648899842] The PCCC Encapsulation Header is:
[950886,648953081] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[950886,649013116] The Returned buffer is:
[950886,649057293] <Buffer a2 02 07 89 00 00>
[950886,649247594] Sending Read Packet SEQ 2
30 Jul 16:42:38 - [error] [pccc endpoint:PLC] Failure (Bad values)
[950888,157673692 192.168.254.220] PacketTimeout called with type read and seq 2
[950888,159541964 192.168.254.220] READ TIMEOUT on sequence number 2
[950888,160123816 192.168.254.220] ReadResponse called
[950888,160600323] Timeout error - zero length packet
[950888,161041715 192.168.254.220] Read Time is 1 seconds and 512.9 ms.
[950888,161529173 192.168.254.220] Every packet done sending
[950888,162021161 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[950888,162513526 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[950888,162999473 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[950888,163548854 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[950888,163951355 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[950888,164308547 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[950888,164661963 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[950888,164975355 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[950888,165238529 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[950888,165503968 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[950888,165768275 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[950888,166031827 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[950888,166303685 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[950888,166511732 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[950888,166691461 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[950888,166868546 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[950888,167043366 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[950888,167229891 192.168.254.220] We are calling back our readDoneCallback.
[950888,167274446 192.168.254.220] Reading All Items (readAllItems was called)
[950888,167319756 192.168.254.220] Calling SRP from RAI
[950888,167363177 192.168.254.220] SendReadPacket called
[950888,167413773] The A2 Returned Buffer is:
[950888,167456062] <Buffer a2 02 07 89 00 00>
[950888,167513455] The returned buffer length is 6
[950888,167555366] The PCCC Encapsulation Header is:
[950888,167596145] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[950888,167644853] The Returned buffer is:
[950888,167686009] <Buffer a2 02 07 89 00 00>
[950888,167860829] Sending Read Packet SEQ 2
30 Jul 16:42:39 - [error] [pccc endpoint:PLC] Failure (Bad values)
[950889,674439424 192.168.254.220] PacketTimeout called with type read and seq 2
[950889,675771152 192.168.254.220] READ TIMEOUT on sequence number 2
[950889,676277488 192.168.254.220] ReadResponse called
[950889,676746066] Timeout error - zero length packet
[950889,677186326 192.168.254.220] Read Time is 1 seconds and 509.8 ms.
[950889,677645087 192.168.254.220] Every packet done sending
[950889,678025311 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[950889,678414975 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[950889,678864296 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[950889,679290585 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[950889,679642868 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[950889,679963812 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[950889,680234160 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[950889,680493936 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[950889,680750313 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[950889,681005936 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[950889,681261558 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[950889,681504343 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[950889,681673122 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[950889,681833594 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[950889,681990290 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[950889,682149629 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[950889,682311234 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[950889,682407517 192.168.254.220] We are calling back our readDoneCallback.
[950889,682455092 192.168.254.220] Reading All Items (readAllItems was called)
[950889,682502667 192.168.254.220] Calling SRP from RAI
[950889,682544956 192.168.254.220] SendReadPacket called
[950889,682595175] The A2 Returned Buffer is:
[950889,682638596] <Buffer a2 02 07 89 00 00>
[950889,682697121] The returned buffer length is 6
[950889,682739410] The PCCC Encapsulation Header is:
[950889,682782455] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[950889,682829652] The Returned buffer is:
[950889,682871186] <Buffer a2 02 07 89 00 00>
[950889,683030148] Sending Read Packet SEQ 2
30 Jul 16:42:41 - [error] [pccc endpoint:PLC] Failure (Bad values)

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

What would cause the timestamp 950882,536746565 to be out of sequence in this log around the time the write packet seems to go out without a reply? That is odd... Or am I just not thinking of something obvious? Is this problem repeatable with many node versions on multiple platforms?

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

I have not tried it on any other platforms or versions of the node. I'm not sure who has had good or bad experience, or what kind of data collection they use with this pccc node. I was hoping that we could get an idea what is going on here and debug it so it could be of use. Right now it's useless and I'll have to resort to using OPC-UA to connect to at least our Allen Bradley Micrologix 1400 PLCs.

from node-red-contrib-pccc.

gfcittolin avatar gfcittolin commented on July 18, 2024

@youngkzy thanks for the information provided. I think we've found the issue.

@plcpeople regarding the time drift, that seems to be a platform-dependant that affects the hrtime() call only. See nodejs/node-v0.x-archive#7898. Hopefully nothing we should worry much about, good to know even though.

Regarding the main issue, you can see that the connection seems to go away around [950882,536746565], but you can't find any log entry of connectionReset() being called. If you follow the code path of packetTimeout() in the case of a read timeout, you'll see that there's no single call to connectionReset(), therefore a new connection attempt will never be done.

I'm not as familiar with this code as with nodes7, but I'd suggest calling self.connectionReset() on packetTimeout() for the read and write case, the same way it's already done on the 'connect' type. This should prevent the whole issue from happening.

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

That may be a good solution... My thinking in not doing a reset here is that the connection timeout may be temporary, such as a lost packet on a slow/unreliable connection, so a retry might be more appropriate as constantly creating new connections without properly disconnecting can quickly use all the connection resources available if the PLC doesn't release them right away. And if the TCP connection is broken you should EVENTUALLY get a socket error, but this can take a long time on a timeout. I wonder why a retry wouldn't work, but a reconnect would? I will see if I can run a test. I don't mind making the change as it is really simple, I just want to make sure we don't cause issues for any existing code.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

@plcpeople and @gfcittolin , I am eagerly awaiting any progress on a test mentioned above in your reply regarding "reconnect". My test setup is connecting through a Tripplite USB 3.0 Dual Gigabit adapter to the PLC with a 3' patch cable. I'm running Windows 10. I connect with this device and I have not had issues with it in any other programming and testing scenarios. That being said, does not mean that the device is not part of the problem. Right now I don't have the expertise or resources to delve into this deeper. However, I am curious to understand what's wrong and how to fix it. Thank you for your insight and willingness to help me resolve this problem.
Kind Regards, @youngkzy.

from node-red-contrib-pccc.

gfcittolin avatar gfcittolin commented on July 18, 2024

I've just spent some hours reading and re-learning some network stuff and doing simulations, and let me share my discoveries that may impact this project and nodeS7 too.

@plcpeople It looks like things can get a bit more complicated when dealing with these dark corners of a TCP socket. Looks like that sending a network packet from a userland process does not necessarily implies that this packet will be sent over the wire. Congestions mechanisms from the OS (and this is therefore OS dependant) may queue them up before receiving the acknowledge of a previous packet.

As a proof of concept, I've setup a connection between my computer and a S7-1200 (PLC brand is irrelevant here, as the same logic is being used on nodeS7), but going over two dummy switches. After connection establishment and data exchange for a while, I unplugged the cable between the two switches, so that neither the PLC nor my PC would detect that the physical link is down (and therefore signalize this to the application). Even though we were calling readAllItems() every 500ms the whole time, this is what happened over the wire:
image
I've reconnected the cable back just after packet 88 has been sent, and we've waited approx. 100 seconds until another retransmission had been done, and then finally got a FIN back from the PLC, showing the connection was dead. Most probably this is the issue happening here, and also on st-one-io/node-red-contrib-s7#30

I think your concern regarding resource exaustion in the PLC is valid and very important, that's why I've invested a lot of time on this after all. But from my experience with industrial networks and after the test above, I'm pretty much convinced that we really need either to reset the connection on packet timeouts, or find another way so that this behavior don't happen. After all, if just a single packet was dropped, we'd close the connection and send a FIN packet, releasing the resource. And if a more permanent issue is taking place preventing the packets from being delivered, closing the connection shouldn't make any difference anyway, as the PLC won't receive anything, having us to rely on PLC mechanisms to free up the resource anyway.

What we can do as to avoid flooding the PLCs with connections is to increase the timeout before actually dropping the connection and creating a new one to something like 5 seconds.

I'll do some more tests and reading about this, but if you agree, I think we should call connectionReset() on both read and write timeouts, both here and on nodeS7. Would love to hear what you think about! Have I missed something? :)

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

@gfcittolin , How is the test going? Did you modify the code to include your suggestion to call "connectionReset()"? Do you plan on submitting a trial version?

Kind Regards,
@youngkzy

from node-red-contrib-pccc.

gfcittolin avatar gfcittolin commented on July 18, 2024

Hello, I was in business trip last week and wasn't able to do any tests or modifications. I plan to work on this tomorrow. I'll run some basic tests and then I let you know about it so you can also test in your environment.

from node-red-contrib-pccc.

gfcittolin avatar gfcittolin commented on July 18, 2024

Dear @youngkzy, @plcpeople has kindly published a new version that implements the fixes proposed on this issue. Could you please confirm the issue has been solved?

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

@gfcittolin , Thank you for your quick response to this. I've tried to keep up, but I missed checking the forum for a few days. I'll test as soon as I can get time today.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

OK, where was the revision posted? How do I test it? Install ?? Update? 1.1.1 is the newest? Please help.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

I followed the link to "plcpeople/nodepccc". And I found the files which I copied to my existing nodepccc folder. I renamed the files "nodePCCC.js" and "package.json" and copied the content to new files from the repository. I ran a test and am running a test to read N7:0 and then increment the number, and if it is higher than 32766 it will reset the value to 0. Then it writes it out to N7:0. I saw an error when I added an inject node to reset the value to 0 manually, but I had not deployed the change when I clicked on the inject. I had to deploy first. The counter is at 1800 and no problems yet if I just watch and don't make changes. I'll watch and update when an error occurs.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

OK, The behavior is now different. It does not continue to repeat the errors indefinitely. It stops at The error is the same as before, "Failure (Bad Values)". The error points back to the PCCC Configuration Node. I made an attempt to recover by injecting a 0, and/or 1. The result is the input and output nodes report a value instead of "Failure", but will not update the PLC with new values. The value sent to the PCCC output registers on the node, but the input does not reflect any activity.

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

I did a lot more testing yesterday with similar behavior seen after the same change on nodeS7 and found that after this new connection reset logic was first triggered, the code would not have a chance to re-establish connection, so I have posted yet another fix. Please test the latest when you have a chance.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

I copied the files from "https://github.com/plcpeople/nodepccc", and applied them to the "nodepccc" folder. I resumed the test which had failed before with similar results. Today's test is going much better! The test comprises of a read node, reading N7:0, an increment/rollover function to the value and then posting the new value with a write node. It usually would bomb anywhere from 1200 or less and that varies on something that is unknown. Today's test is going much better with a count of around 22,000 with 3 hours under the belt.

Well, It just bombed at 21,633... The difference is that I had let my PC alone for a couple of hours this morning... Upon returning, I was in the process of checking the functions and writing this response. After I updated it just now, I checked and it was in error, again. "Failure (Bad values)". Reset and it bombed again at 21,900. (sigh...)

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

Any chance of getting verbose output of the latest failure?

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

[717325,833391040] <Buffer 6f 00 21 00 d6 0f a9 e1 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[717325,834152242] onResponse called with length 57
[717325,834636678] Valid EIP Data Response Received
[717325,835099592] Received 17 bytes of CIP-data from PLC.
[717325,835573833] Received 13 bytes of PCCC-data from PLC.
[717325,836037502] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 91 5d>
[717325,836539685] On Response - Sequence 2
[717325,837003354] Received Response to Sequence 0
[717325,837456450 192.168.254.220] ReadResponse called
[717325,838185936 192.168.254.220] Byte Buffer is:
[717325,838651871 192.168.254.220] <Buffer 91 5d>
[717325,839044177 192.168.254.220] Read Time is 0 seconds and 19.4 ms.
[717325,839346619 192.168.254.220] Every packet done sending
[717325,839625273 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,839881273 192.168.254.220] Address N7:0/0 has value true and quality OK
[717325,840141426 192.168.254.220] Item Datatype (single value) is INT and BO is -1
[717325,840407243 192.168.254.220] Address N7:0 has value 23953 and quality OK
[717325,840665130 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,840928682 192.168.254.220] Address N7:0/1 has value false and quality OK
[717325,841126911 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,841294557 192.168.254.220] Address N7:0/2 has value false and quality OK
[717325,841470510 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,841608704 192.168.254.220] Address N7:0/3 has value false and quality OK
[717325,841657412 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,841707631 192.168.254.220] Address N7:0/4 has value true and quality OK
[717325,841755583 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,841804669 192.168.254.220] Address N7:0/5 has value false and quality OK
[717325,841852622 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,841900574 192.168.254.220] Address N7:0/6 has value false and quality OK
[717325,841950037 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,841997990 192.168.254.220] Address N7:0/7 has value true and quality OK
[717325,842045943 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842149022 192.168.254.220] Address N7:0/8 has value true and quality OK
[717325,842199240 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842249081 192.168.254.220] Address N7:0/9 has value false and quality OK
[717325,842298167 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842345742 192.168.254.220] Address N7:0/10 has value true and quality OK
[717325,842396338 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842444290 192.168.254.220] Address N7:0/11 has value true and quality OK
[717325,842492243 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842542084 192.168.254.220] Address N7:0/12 has value true and quality OK
[717325,842590036 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842638744 192.168.254.220] Address N7:0/13 has value false and quality OK
[717325,842686697 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842733895 192.168.254.220] Address N7:0/14 has value true and quality OK
[717325,842782980 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717325,842830933 192.168.254.220] Address N7:0/15 has value false and quality OK
[717325,842878886 192.168.254.220] We are calling back our readDoneCallback.
[717325,843036337 192.168.254.220] Preparing to WRITE N7:0
[717325,844052784 192.168.254.220] Clearing write PacketTimeouts
[717325,844114707] WPAL is 1
[717325,844166813 192.168.254.220] SendWritePacket called from WriteItems
[717325,844372595] AddrInfo WriteBuffer[0] is 146
[717325,844431497] The returned buffer length is 8
[717325,844630482 192.168.254.220] Sending Write Packet With Sequence Number 404
[717325,852699758] <Buffer 6f 00 1f 00 d6 0f a9 e1 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 0f 00 cb 00 00 00 07 00 00 01 02 03 ... >
[717325,853392618] onResponse called with length 55
[717325,853694305] Valid EIP Data Response Received
[717325,854081325] Received 15 bytes of CIP-data from PLC.
[717325,854488357] Received 11 bytes of PCCC-data from PLC.
[717325,854854610] <Buffer 07 00 00 01 02 03 04 4f 00 94 01>
[717325,855365099] On Response - Sequence 404
[717325,855825370 192.168.254.220] We're in write response seq num 0 of 1
[717325,856316980] Time is 0 seconds and 12 ms.
[717325,858095385 192.168.254.220] Sending more packets from writeResponse
[717325,858462015] N7:0 write completed with quality OK
[717326,317975367 192.168.254.220] Reading All Items (readAllItems was called)
[717326,318758092 192.168.254.220] Calling SRP from RAI
[717326,319287082 192.168.254.220] SendReadPacket called
[717326,319995423] The A2 Returned Buffer is:
[717326,320454939] <Buffer a2 02 07 89 00 00>
[717326,320968449] The returned buffer length is 6
[717326,321443445] The PCCC Encapsulation Header is:
[717326,321893899] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[717326,322405520] The Returned buffer is:
[717326,322865791] <Buffer a2 02 07 89 00 00>
[717326,323697979] Sending Read Packet SEQ 2
[717326,333188468] <Buffer 6f 00 21 00 d6 0f a9 e1 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[717326,334414850] onResponse called with length 57
[717326,334914389] Valid EIP Data Response Received
[717326,335383722] Received 17 bytes of CIP-data from PLC.
[717326,335875709] Received 13 bytes of PCCC-data from PLC.
[717326,336328051] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 92 5d>
[717326,336850245] On Response - Sequence 2
[717326,337298810] Received Response to Sequence 0
[717326,337755305 192.168.254.220] ReadResponse called
[717326,338410785 192.168.254.220] Byte Buffer is:
[717326,338722289 192.168.254.220] <Buffer 92 5d>
[717326,339048897 192.168.254.220] Read Time is 0 seconds and 19.3 ms.
[717326,339348696 192.168.254.220] Every packet done sending
[717326,339619043 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,339889013 192.168.254.220] Address N7:0/0 has value false and quality OK
[717326,340171821 192.168.254.220] Item Datatype (single value) is INT and BO is -1
[717326,340444057 192.168.254.220] Address N7:0 has value 23954 and quality OK
[717326,340692505 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,340788033 192.168.254.220] Address N7:0/1 has value true and quality OK
[717326,340836741 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,340885449 192.168.254.220] Address N7:0/2 has value false and quality OK
[717326,340934534 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,340982487 192.168.254.220] Address N7:0/3 has value false and quality OK
[717326,341033460 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341081413 192.168.254.220] Address N7:0/4 has value true and quality OK
[717326,341136162 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341252835 192.168.254.220] Address N7:0/5 has value false and quality OK
[717326,341324197 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341401224 192.168.254.220] Address N7:0/6 has value false and quality OK
[717326,341468811 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341525070 192.168.254.220] Address N7:0/7 has value true and quality OK
[717326,341584728 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341642120 192.168.254.220] Address N7:0/8 has value true and quality OK
[717326,341699890 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341761813 192.168.254.220] Address N7:0/9 has value false and quality OK
[717326,341833554 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341893967 192.168.254.220] Address N7:0/10 has value true and quality OK
[717326,341945317 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,341994025 192.168.254.220] Address N7:0/11 has value true and quality OK
[717326,342108810 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,342160161 192.168.254.220] Address N7:0/12 has value true and quality OK
[717326,342208869 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,342258710 192.168.254.220] Address N7:0/13 has value false and quality OK
[717326,342307795 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,342356880 192.168.254.220] Address N7:0/14 has value true and quality OK
[717326,342405588 192.168.254.220] Item Datatype (single value) is X and BO is -1
[717326,342453541 192.168.254.220] Address N7:0/15 has value false and quality OK
[717326,342503382 192.168.254.220] We are calling back our readDoneCallback.
[717326,342657812 192.168.254.220] Preparing to WRITE N7:0
[717326,343702955 192.168.254.220] Clearing write PacketTimeouts
[717326,343770542] WPAL is 1
[717326,343823404 192.168.254.220] SendWritePacket called from WriteItems
[717326,344031828] AddrInfo WriteBuffer[0] is 147
[717326,344089598] The returned buffer length is 8
[717326,344305952 192.168.254.220] Sending Write Packet With Sequence Number 405
[717326,818050694 192.168.254.220] Reading All Items (readAllItems was called)
[717326,818808876] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717326,927510561 192.168.254.220] Reading All Items (readAllItems was called)
[717326,927968567] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,36767290 192.168.254.220] Reading All Items (readAllItems was called)
[717327,37779584] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,146253588 192.168.254.220] Reading All Items (readAllItems was called)
[717327,147055947] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,255439332 192.168.254.220] Reading All Items (readAllItems was called)
[717327,256186564] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,364954703 192.168.254.220] Reading All Items (readAllItems was called)
[717327,365722702] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,474362842 192.168.254.220] Reading All Items (readAllItems was called)
[717327,475531076] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,583738508 192.168.254.220] Reading All Items (readAllItems was called)
[717327,584477811] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,693141738 192.168.254.220] Reading All Items (readAllItems was called)
[717327,693916156] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,802612178 192.168.254.220] Reading All Items (readAllItems was called)
[717327,803355256] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[717327,850673660 192.168.254.220] PacketTimeout called with type write and seq 405
[717327,851415228 192.168.254.220] WRITE TIMEOUT on sequence number 405
[717327,851925340 192.168.254.220] We're in write response seq num 0 of 1
[717327,852416195 192.168.254.220] No communication to PLC.
[717327,852864760] Stopping Processing Write Response Packet due to unrecoverable packet error
[717327,853293314] Time is 1 seconds and 509.3 ms.
[717327,853727910 192.168.254.220] Sending more packets from writeResponse
[717327,854107378] N7:0 write completed with quality BAD
11 Sep 16:30:33 - [error] [pccc endpoint:6eddab8f.7d6114] Failure (Bad values)
[717327,856865227 192.168.254.220] ConnectionReset from write packet timeout.
[717327,857349285] ConnectionReset is happening
[717327,911922145 192.168.254.220] Reading All Items (readAllItems was called)
[717327,913073389 192.168.254.220] Unable to read when not connected. Return bad values.
[717327,913403772 192.168.254.220] Calling SRP from RAI
[717327,913711878 192.168.254.220] SendReadPacket called
[717327,914413045] The A2 Returned Buffer is:
[717327,914799687] <Buffer a2 02 07 89 00 00>
[717327,915237303] The returned buffer length is 6
[717327,915551073] The PCCC Encapsulation Header is:
[717327,915717963] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[717327,915843698] The Returned buffer is:
[717327,915955462] <Buffer a2 02 07 89 00 00>
[717327,916104228 192.168.254.220] Not Sending Read Packet because we are not connected - ISO CS is 0
[717327,916256771 192.168.254.220] Requesting PacketTimeout Due to ISO CS NOT 4 - READ SN 2
[717327,927441842 192.168.254.220] PacketTimeout called with type read and seq 2
[717327,927679340 192.168.254.220] READ TIMEOUT on sequence number 2
[717327,927843210 192.168.254.220] ReadResponse called
[717327,928102608 192.168.254.220] Timeout error - zero length packet
[717327,928262702 192.168.254.220] Read Time is 0 seconds and 14.2 ms.
[717327,928564011 192.168.254.220] Every packet done sending
[717327,928975197 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[717327,929155680 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[717327,929323326 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[717327,929412813 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[717327,929491727 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[717327,929571774 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[717327,929651444 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[717327,929728470 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[717327,929805119 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[717327,929879880 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[717327,929954263 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[717327,930049791 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[717327,930122287 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[717327,930196292 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[717327,930268410 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[717327,930339018 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[717327,930425861 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[717327,930494581 192.168.254.220] We are calling back our readDoneCallback.
[717327,930564811 192.168.254.220] Reading All Items (readAllItems was called)
[717327,930633908 192.168.254.220] Unable to read when not connected. Return bad values.
[717327,930701873 192.168.254.220] Calling SRP from RAI
[717327,930767194 192.168.254.220] SendReadPacket called
[717327,930955985] The A2 Returned Buffer is:
[717327,931028858] <Buffer a2 02 07 89 00 00>
[717327,931119099] The returned buffer length is 6
[717327,931185554] The PCCC Encapsulation Header is:
[717327,931247854] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[717327,931328279] The Returned buffer is:
[717327,931389070] <Buffer a2 02 07 89 00 00>
[717327,931479689 192.168.254.220] Not Sending Read Packet because we are not connected - ISO CS is 0
[717327,931553317 192.168.254.220] Requesting PacketTimeout Due to ISO CS NOT 4 - READ SN 2
11 Sep 16:30:33 - [error] [pccc endpoint:6eddab8f.7d6114] Failure (Bad values)
[717327,932320183] ResetNOW is happening
[717327,932439121] Clearing an earlier scheduled reset
[717327,932531629] Connection cleanup is happening
[717327,932615451 192.168.254.220] Clearing read PacketTimeouts
[717327,932708336 192.168.254.220] Clearing write PacketTimeouts
[717327,932976418 192.168.254.220]
[717327,933195038 192.168.254.220] Attempting to connect to host...
[717327,934941726 192.168.254.220] TCP Connection Established to 192.168.254.220 on port 44818 - Will attempt EIP Connection
[717327,942555261 192.168.254.220] EIP Register Session Response Received - connection confirmed
[717327,942866010 192.168.254.220] Session Handle is 0x7D502AC1
11 Sep 17:16:52 - [trace] comms.close aRkc6cW5XZo3zfPdRZZJ9k7YbYu9OWjm

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

Another weekend, another version, sorry it takes me a few days to get to this each time. The verbose output was really useful in understanding what is happening - in cases where more reads or writes are done in the callback, the way we were doing the reset can lead to a non-response and therefore communication would stop. I am really hoping this is the end of the issue with these changes. I have a test running in Node-RED (previous testing was outside of Node-RED) and I will let it run overnight, but it has recovered quickly from anything I have done so far.

I added a bit more output as well, so please post verbose output if you are able to make it fail again.

My flow is very simple and hopefully close enough to yours.

image

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

My Node-RED program is taking the input value and increment by 1. If it is the numerical value, 32,767, or higher, it resets to 0. There is no delay, The system is only limited in speed by the read/write functions and the response time from Node-RED. Should I include a 500ms delay? I don't see the means for your program to increment, or change the value. You must be incrementing "TheInt" in the PLC and just writing it to TheIntWrite and those are not the same address. I'll try to monitor it tomorrow 9-17-2019. Thanks for your time to fix this. Kind Regards,

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

Correct, the PLC was incrementing the value. I modified my flow with no delay to be more similar to yours, reading/writing the same value and incrementing in Node-RED and it works. I don't think you need a delay as the "cycle time" is set to 500ms which will add a delay between the write and the read.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

UPDATE:
I'll try to capture the verbose log, I'm not able to watch it that close to catch the error as it occurs. Either way I'll get you the output. The function counts normally. Then when the error happens, it gives the output error "Failure (Bad values)", At that point it does not continue to send errors to the debug screen but then stops counting. i.e. it halts its process of responding to the input changes, because it failed on the last attempt. The good news is that I can send it a 0 value or other known value and it resumes activity. At least if it errors, it can still resume its function. This is an improvement! If there is an error detected, what is the recommended detection and recovery? I tried using the error catch, but it does not work. I'm wondering how to get the system to force an update when it had an error.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

This is the capture I promised in the last post. I'm hoping it provides insight.

The only problem I can identify is a small one. If there is an error either reading or writing, I would need to READ again, or WRITE again after the error in order to ensure the values are complete. Since the ERROR in Node-RED is relative to the "Configuration" Node, the system does not allow usage of the "Catch Error" node in Node-RED. It seems the "Catch Error" Node only will work on the flow tab it resides. Since the node which errors is actually the "Configuration" Node. I don't know how to "Catch" this error and re-do a WRITE or a READ that had failed. I'm assuming the ERROR needs to be passed to the READ and/or WRITE node on the flow page....

[518305,588837047 192.168.254.220] Preparing to WRITE N7:0
[518305,588958250 192.168.254.220] Clearing write PacketTimeouts
[518305,589016398] WPAL is 1
[518305,589064350 192.168.254.220] SendWritePacket called from WriteItems
[518305,589123253] AddrInfo WriteBuffer[0] is 2
[518305,589171206] The returned buffer length is 8
[518305,589334698 192.168.254.220] Sending Write Packet With Sequence Number 2042
[518305,596089243] <Buffer 6f 00 1f 00 f8 a9 18 14 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 0f 00 cb 00 00 00 07 00 00 01 02 03 ... >
[518305,596395839] onResponse called with length 55
[518305,596669207] Valid EIP Data Response Received
[518305,596902552] Received 15 bytes of CIP-data from PLC.
[518305,597085301] Received 11 bytes of PCCC-data from PLC.
[518305,597172145] <Buffer 07 00 00 01 02 03 04 4f 00 fa 07>
[518305,597262765] On Response - Sequence 2042
[518305,597344322 192.168.254.220] We're in write response seq num 0 of 1
[518305,597425502 192.168.254.220] Time is 0 seconds and 8.3 ms.
[518305,597508947 192.168.254.220] Received all packets in writeResponse
[518305,597583708 192.168.254.220] N7:0 write completed with quality OK
[518305,597639968 192.168.254.220] We are calling back our writeDoneCallback.
[518306,52638554 192.168.254.220] Reading All Items (readAllItems was called)
[518306,53564005 192.168.254.220] Calling SRP from RAI
[518306,53867957 192.168.254.220] SendReadPacket called
[518306,54094506] The A2 Returned Buffer is:
[518306,54304441] <Buffer a2 02 07 89 00 00>
[518306,54541184] The returned buffer length is 6
[518306,54689573] The PCCC Encapsulation Header is:
[518306,54778305] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[518306,54912724] The Returned buffer is:
[518306,54979555] <Buffer a2 02 07 89 00 00>
[518306,55237066] Sending Read Packet SEQ 2
[518306,66058157] <Buffer 6f 00 21 00 f8 a9 18 14 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[518306,66388918] onResponse called with length 57
[518306,66648693] Valid EIP Data Response Received
[518306,66877130] Received 17 bytes of CIP-data from PLC.
[518306,67102546] Received 13 bytes of PCCC-data from PLC.
[518306,67315879] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 02 07>
[518306,67520150] On Response - Sequence 2
[518306,67639843] Received Response to Sequence 0
[518306,67761424 192.168.254.220] ReadResponse called
[518306,67873943 192.168.254.220] Byte Buffer is:
[518306,67920763 192.168.254.220] <Buffer 02 07>
[518306,67978156 192.168.254.220] Read Time is 0 seconds and 13.9 ms.
[518306,68036303 192.168.254.220] Every packet done sending
[518306,68096339 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68144291 192.168.254.220] Address N7:0/0 has value false and quality OK
[518306,68192622 192.168.254.220] Item Datatype (single value) is INT and BO is -1
[518306,68238687 192.168.254.220] Address N7:0 has value 1794 and quality OK
[518306,68286262 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68331949 192.168.254.220] Address N7:0/1 has value true and quality OK
[518306,68377636 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68424834 192.168.254.220] Address N7:0/2 has value false and quality OK
[518306,68470521 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68518474 192.168.254.220] Address N7:0/3 has value false and quality OK
[518306,68564539 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68609471 192.168.254.220] Address N7:0/4 has value false and quality OK
[518306,68669884 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68750686 192.168.254.220] Address N7:0/5 has value false and quality OK
[518306,68804303 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68855276 192.168.254.220] Address N7:0/6 has value false and quality OK
[518306,68905494 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,68952692 192.168.254.220] Address N7:0/7 has value false and quality OK
[518306,68999135 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69044822 192.168.254.220] Address N7:0/8 has value true and quality OK
[518306,69092397 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69138462 192.168.254.220] Address N7:0/9 has value true and quality OK
[518306,69184149 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69231724 192.168.254.220] Address N7:0/10 has value true and quality OK
[518306,69278167 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69324232 192.168.254.220] Address N7:0/11 has value false and quality OK
[518306,69373695 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69419382 192.168.254.220] Address N7:0/12 has value false and quality OK
[518306,69467712 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69513777 192.168.254.220] Address N7:0/13 has value false and quality OK
[518306,69559087 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69605529 192.168.254.220] Address N7:0/14 has value false and quality OK
[518306,69652350 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518306,69699547 192.168.254.220] Address N7:0/15 has value false and quality OK
[518306,69749765 192.168.254.220] We are calling back our readDoneCallback.
[518306,69909860 192.168.254.220] Preparing to WRITE N7:0
[518306,70018603 192.168.254.220] Clearing write PacketTimeouts
[518306,70072219] WPAL is 1
[518306,70119040 192.168.254.220] SendWritePacket called from WriteItems
[518306,70176054] AddrInfo WriteBuffer[0] is 3
[518306,70225517] The returned buffer length is 8
[518306,70416196 192.168.254.220] Sending Write Packet With Sequence Number 2043
[518306,552236241 192.168.254.220] Reading All Items (readAllItems was called)
[518306,553196807] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518306,653919912 192.168.254.220] Reading All Items (readAllItems was called)
[518306,654671676] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518306,754552021 192.168.254.220] Reading All Items (readAllItems was called)
[518306,755431784] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518306,856398429 192.168.254.220] Reading All Items (readAllItems was called)
[518306,857307644] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518306,957427375 192.168.254.220] Reading All Items (readAllItems was called)
[518306,958660554] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518307,59282090 192.168.254.220] Reading All Items (readAllItems was called)
[518307,60267576] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518307,160078823 192.168.254.220] Reading All Items (readAllItems was called)
[518307,161019377] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518307,261687356 192.168.254.220] Reading All Items (readAllItems was called)
[518307,262562966] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518307,362530909 192.168.254.220] Reading All Items (readAllItems was called)
[518307,364509433] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518307,464180220 192.168.254.220] Reading All Items (readAllItems was called)
[518307,467811416] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518307,568746344 192.168.254.220] Reading All Items (readAllItems was called)
[518307,569902874] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[518307,570744125 192.168.254.220] PacketTimeout called with type write and seq 2043
[518307,571276136 192.168.254.220] WRITE TIMEOUT on sequence number 2043
[518307,571533646 192.168.254.220] ConnectionReset from write packet timeout.
[518307,571672974 192.168.254.220] ConnectionReset has been called to set the reset as pending
[518307,571911227 192.168.254.220] We're in write response seq num 0 of 1
[518307,572154012 192.168.254.220] No communication to PLC.
[518307,572389622] Stopping Processing Write Response Packet due to unrecoverable packet error
[518307,572616926 192.168.254.220] Time is 1 seconds and 502.4 ms.
[518307,572751345 192.168.254.220] Received all packets in writeResponse
[518307,572975250 192.168.254.220] N7:0 write completed with quality BAD
[518307,573202554 192.168.254.220] Calling reset from writeResponse as there is one pending
[518307,573522365 192.168.254.220] ResetNOW is happening
[518307,573633751] Connection cleanup is happening
[518307,573721350 192.168.254.220] Clearing read PacketTimeouts
[518307,573887486 192.168.254.220] Clearing write PacketTimeouts
[518307,574101197 192.168.254.220]
[518307,574326235 192.168.254.220] Attempting to connect to host...
[518307,574440264 192.168.254.220] We are calling back our writeDoneCallback.
19 Sep 09:54:26 - [error] [pccc endpoint:6eddab8f.7d6114] Failure (Bad values)
[518307,578734492 192.168.254.220] TCP Connection Established to 192.168.254.220 on port 44818 - Will attempt EIP Connection
[518307,586380883 192.168.254.220] EIP Register Session Response Received - connection confirmed
[518307,586755821 192.168.254.220] Session Handle is 0x85A3ED86
[518307,670342039 192.168.254.220] Reading All Items (readAllItems was called)
[518307,671860292 192.168.254.220] Calling SRP from RAI
[518307,672929223 192.168.254.220] SendReadPacket called
[518307,673150863] The A2 Returned Buffer is:
[518307,673315111] <Buffer a2 02 07 89 00 00>
[518307,673563937] The returned buffer length is 6
[518307,673779913] The PCCC Encapsulation Header is:
[518307,674009105] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[518307,674229989] The Returned buffer is:
[518307,674434638] <Buffer a2 02 07 89 00 00>
[518307,674748408] Sending Read Packet SEQ 2
[518307,686376390] <Buffer 6f 00 21 00 86 ed a3 85 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[518307,687193097] onResponse called with length 57
[518307,688525958] Valid EIP Data Response Received
[518307,688798194] Received 17 bytes of CIP-data from PLC.
[518307,688935633] Received 13 bytes of PCCC-data from PLC.
[518307,689025120] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 02 07>
[518307,689233167] On Response - Sequence 2
[518307,689830500] Received Response to Sequence 0
[518307,691718404 192.168.254.220] ReadResponse called
[518307,691995171 192.168.254.220] Byte Buffer is:
[518307,692217566 192.168.254.220] <Buffer 02 07>
[518307,692435808 192.168.254.220] Read Time is 0 seconds and 19.3 ms.
[518307,692529826 192.168.254.220] Every packet done sending
[518307,692748445 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,692940634 192.168.254.220] Address N7:0/0 has value false and quality OK
[518307,693128291 192.168.254.220] Item Datatype (single value) is INT and BO is -1
[518307,693214380 192.168.254.220] Address N7:0 has value 1794 and quality OK
[518307,693328032 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,693381648 192.168.254.220] Address N7:0/1 has value true and quality OK
[518307,693432622 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,693500964 192.168.254.220] Address N7:0/2 has value false and quality OK
[518307,693613483 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,693702969 192.168.254.220] Address N7:0/3 has value false and quality OK
[518307,693755453 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,693804539 192.168.254.220] Address N7:0/4 has value false and quality OK
[518307,693853247 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,693902710 192.168.254.220] Address N7:0/5 has value false and quality OK
[518307,693951418 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694000503 192.168.254.220] Address N7:0/6 has value false and quality OK
[518307,694049211 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694096786 192.168.254.220] Address N7:0/7 has value false and quality OK
[518307,694147005 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694194957 192.168.254.220] Address N7:0/8 has value true and quality OK
[518307,694242910 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694292373 192.168.254.220] Address N7:0/9 has value true and quality OK
[518307,694342214 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694391300 192.168.254.220] Address N7:0/10 has value true and quality OK
[518307,694439630 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694496267 192.168.254.220] Address N7:0/11 has value false and quality OK
[518307,694555925 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694615205 192.168.254.220] Address N7:0/12 has value false and quality OK
[518307,694665423 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694720172 192.168.254.220] Address N7:0/13 has value false and quality OK
[518307,694768880 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694817966 192.168.254.220] Address N7:0/14 has value false and quality OK
[518307,694865919 192.168.254.220] Item Datatype (single value) is X and BO is -1
[518307,694913494 192.168.254.220] Address N7:0/15 has value false and quality OK
[518307,694963712 192.168.254.220] We are calling back our readDoneCallback.
[518307,695012798 192.168.254.220] Reading All Items (readAllItems was called)
[518307,695062638 192.168.254.220] Calling SRP from RAI
[518307,695110969 192.168.254.220] SendReadPacket called
[518307,695167606] The A2 Returned Buffer is:
[518307,695217069] <Buffer a2 02 07 89 00 00>
[518307,695274461] The returned buffer length is 6
[518307,695323169] The PCCC Encapsulation Header is:
[518307,695373010] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[518307,695427381] The Returned buffer is:
[518307,695503653] <Buffer a2 02 07 89 00 00>
[518307,695744549] Sending Read Packet SEQ 2
[518307,707400094] <Buffer 6f 00 21 00 86 ed a3 85 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[518307,708243988] onResponse called with length 57
[518307,708444106] Valid EIP Data Response Received
[518307,708607976] Received 17 bytes of CIP-data from PLC.
[518307,708825085] Received 13 bytes of PCCC-data from PLC.
[518307,709045592] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 02 07>
[518307,709286111] On Response - Sequence 2
[518307,709453757] Received Response to Sequence 0
[518307,709681061 192.168.254.220] ReadResponse called
[518307,709780742 192.168.254.220] Byte Buffer is:
[518307,709843798 192.168.254.220] <Buffer 02 07>
[518307,709923845 192.168.254.220] Read Time is 0 seconds and 14.8 ms.
[518307,710046181 192.168.254.220] Every packet done sending

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

How can I avoid these errors in the first place? Do I need to adjust the default parameters for a longer cycle time? Timeout?

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

Nick O'Leary at Node-RED.org wrote in reply to a question about triggering a Catch Node... It looks like a simple update.

"the Catch node will only handle errors that have been logged 'properly'. If the node simply calls node.error("my message"); then that will appear in the sidebar and log, but it will not trigger a Catch node.

To trigger a Catch node, the call to node.error() must also provide the message that triggered the error - node.error("my message", msg).

If you search through the src of the pccc node - https://github.com/netsmarttech/node-red-contrib-pccc/blob/master/red/pccc.js - you can see it only ever provides an error string to the node.error() call., it never provides the second argument so it will not trigger the Catch node.

The node would need to be updated for you to be able to handle those errors with the Catch node."

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

I think from looking at the earlier Wireshark captures that there is something unique to your network causing the timeout errors but @gfcittolin looked into this a bit more. If I am direct connected I don't see any errors at all for days unless I create them. But I am testing with a SLC 5/03 and ENI module so response times are much longer (50ms). But I think somehow packets might be getting dropped. Either way, it should recover from any error when communication is possible again and it seems to be doing that now.

Is that verbose output truncated? It looks normal now - it looks like it resumed communication after the error. Is there any chance there is anything else you could do in your flow to make it write after an error? I did a simple flow that would do a read and a write without much else and it resumed after an error just fine without anything to catch an error, although you might want to modify the call to node.error as suggested to see if that helps.

This simple flow (the function is basically just return msg;) immediately starts printing debug messages after recovering from a failure. Does your flow do this if you put a debug right after your read?

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

It does resume after an error. My system is connected directly to a test Micrologix 1400 PLC with no other item in between. The dropping packets could be just from the Tripplite USB 3.0 dual gigabit Ethernet adapter. It usually does not have errors unless I'm working and using my browser. If I don't do anything, it behaves well. Nonetheless, I'd like to get it to update or read properly even if it does have an error.

The debug message only shows the message object. From the message, I cannot get the fact it had any errors. The error does show up on the debug pane, but the errors cannot be caught by the CATCH ERROR Node. Reference prior post quote from Nick O'Leary. I think the programming works OK NOW. It's just necessary to capture errors in context to read/write function which did or did not happen due to errors. If my PLC Program increments the value like yours, it would just march on because the read values will catch the next change. However, the problem exists that if data exchange is rare and unique events that need to be caught, We may miss them when they coincide with an error of some sort. Or maybe I'm overthinking this...

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

Hopefully it works if you're able to test Nick's proposed changes and the problem is solved after that. I am not sure what to suggest if the flow misses a rare event without knowing more about the application other than we've had to store rare events in the PLC to make sure they weren't missed by a computer, even with other software. But I think you might see an improvement with a different Ethernet adapter because there won't likely be any errors to cause problems then.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

@gfcittolin,
I tried to implement the update that Nick O'Leary suggested. He says...

"To trigger a Catch node, the call to node.error() must also provide the message that triggered the error - node.error("my message", msg). If you search through the src of the pccc node - https://github.com/netsmarttech/node-red-contrib-pccc/blob/master/red/pccc.js - you can see it only ever provides an error string to the node.error() call., it never provides the second argument so it will not trigger the Catch node."

My results of just updating the code with ", msg" adding the second parameter failed because it does not have a reference to "msg". The scope is a problem. Can you please help by taking a look at this in order to help me resolve exposing the errors to the "Catch Error" Node? This would help very much and I think it would be helpful to anyone else using the node(s).

Kind Regards.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

@gfcittolin,
Paradigm shift... I tried using the "Status" Node and that actually works very much like I thought the "Catch Error" node would. Instead of catching the error thrown to the debug pane, I have to monitor the msg.status.text for value of "Failure". This can act to monitor for connection error. As programmed, it resumes because it is forcing the last known good value kept in a flow variable to the count function. This is the kind of thing I was looking to monitor for re-sending values to the PLC. The PLC, if not in error, should update the READ with new current values. I contend that since the means to update the "CATCH ERROR" Node are known, you should pursue it because the "Failure" is an error, thus should be caught by the "Catch Error" Node.
NewParadigm

from node-red-contrib-pccc.

gfcittolin avatar gfcittolin commented on July 18, 2024

So sorry for not having time for working on this lately, I've been extremely busy at work and outside it. (Thanks @plcpeople for your support here!) I'll try to take a look on this during this week.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

@gfcittolin,
There is a problem with my recovery circuit. It seems that I CRASH Node-RED if there is a simultaneous error condition on the Input and the Output Nodes and cause the system to process both "pccc in" and "pccc out" I tried to log the errors, but it just hard crashes Node-RED. To avoid this problem, you have to separate the conditions of the "Status" by each node separately, and delay one from the other by a time delay. I am also guessing that any recovery with the "Catch Error" node would have to be isolated as well.

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

New Circuit... The system works better if the first detected error, "output", is delayed and the second "input" error should also be delayed from the first resulting error. The input condition and output condition are very close in time. In order to prevent things overlapping delays in the results are needed. You could probably ignore the "input" error. But this shows you can do some logic on it if you need to.

revisedparadigm

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

Holy Moly! Can this get any more frustrating?

I had it all working, Then I discovered a problem with some of the injection nodes not able to select false values for boolean datatypes. Nick O'Leary responds back and says "You need to upgrade Node-RED to 1.0.0 instead of your current beta version. OK I upgrade and now we are back with problems with errors that won't reset with 'node-red-contrib-pccc' : (

@gfcittolin and @plcpeople , Can you once again help with this? or... can you please indicate what bug may be causing problems with the reset?

I'll post the detail results again for you here.

Kind Regards,
@youngkzy

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

[80007,269296061 192.168.254.220] Preparing to WRITE N7:0
[80007,269409335 192.168.254.220] Clearing write PacketTimeouts
[80007,269465595] WPAL is 1
[80007,269523365] AddrInfo WriteBuffer[0] is 203
[80007,269576226] The returned buffer length is 8
[80007,269738585 192.168.254.220] Sending Write Packet With Sequence Number 1098
[80007,274170248] <Buffer 6f 00 1f 00 db 61 cb bb 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 0f 00 cb 00 00 00 07 00 00 01 02 03 ... >
[80007,274419451] onResponse called with length 55
[80007,274625232] Valid EIP Data Response Received
[80007,274816288] Received 15 bytes of CIP-data from PLC.
[80007,274923521] Received 11 bytes of PCCC-data from PLC.
[80007,275015273] <Buffer 07 00 00 01 02 03 04 4f 00 4a 04>
[80007,275083992] On Response - Sequence 1098
[80007,275148936] Time is 0 seconds and 5.6 ms.
[80007,275255036] N7:0 write completed with quality OK
[80007,759782166 192.168.254.220] Reading All Items (readAllItems was called)
[80007,760363640 192.168.254.220] Calling SRP from RAI
[80007,760768784 192.168.254.220] SendReadPacket called
[80007,761138435] The A2 Returned Buffer is:
[80007,761477502] <Buffer a2 02 07 89 00 00>
[80007,761796935] The returned buffer length is 6
[80007,762102398] The PCCC Encapsulation Header is:
[80007,762404840] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[80007,762609866] The Returned buffer is:
[80007,762870774] <Buffer a2 02 07 89 00 00>
[80007,763268744] Sending Read Packet SEQ 2
[80007,774608618] <Buffer 6f 00 21 00 db 61 cb bb 00 00 00 00 00 00 00 01 00 28 1e 4d 00 00 00 00 00 00 00 00 00 04 02 00 00 00 00 00 b2 00 11 00 cb 00 00 00 07 00 00 01 02 03 ... >
[80007,775195379] onResponse called with length 57
[80007,776270350] Valid EIP Data Response Received
[80007,776504072] Received 17 bytes of CIP-data from PLC.
[80007,776847671] Received 13 bytes of PCCC-data from PLC.
[80007,777084791] <Buffer 07 00 00 01 02 03 04 4f 00 02 00 cb 74>
[80007,777336260] On Response - Sequence 2
[80007,777548460] Received Response to Sequence 0
[80007,777771988 192.168.254.220] ReadResponse called
[80007,778015527] Byte Buffer is:
[80007,778331562] <Buffer cb 74>
[80007,778550936 192.168.254.220] Read Time is 0 seconds and 17.4 ms.
[80007,778747278 192.168.254.220] Every packet done sending
[80007,778840163] Item Datatype (single value) is X and BO is -1
[80007,778898688 192.168.254.220] Address N7:0/0 has value true and quality OK
[80007,778996481] Item Datatype (single value) is INT and BO is -1
[80007,779062558 192.168.254.220] Address N7:0 has value 29899 and quality OK
[80007,779185649] Item Datatype (single value) is X and BO is -1
[80007,779337436 192.168.254.220] Address N7:0/1 has value true and quality OK
[80007,779443914] Item Datatype (single value) is X and BO is -1
[80007,779506215 192.168.254.220] Address N7:0/2 has value false and quality OK
[80007,779583996] Item Datatype (single value) is X and BO is -1
[80007,779698781 192.168.254.220] Address N7:0/3 has value true and quality OK
[80007,779809790] Item Datatype (single value) is X and BO is -1
[80007,779908338 192.168.254.220] Address N7:0/4 has value false and quality OK
[80007,780007264] Item Datatype (single value) is X and BO is -1
[80007,780136397 192.168.254.220] Address N7:0/5 has value false and quality OK
[80007,780281010] Item Datatype (single value) is X and BO is -1
[80007,780451299 192.168.254.220] Address N7:0/6 has value true and quality OK
[80007,780535499] Item Datatype (single value) is X and BO is -1
[80007,780619700 192.168.254.220] Address N7:0/7 has value true and quality OK
[80007,780751475] Item Datatype (single value) is X and BO is -1
[80007,780904018 192.168.254.220] Address N7:0/8 has value false and quality OK
[80007,780981422] Item Datatype (single value) is X and BO is -1
[80007,781033150 192.168.254.220] Address N7:0/9 has value false and quality OK
[80007,781084879] Item Datatype (single value) is X and BO is -1
[80007,781140006 192.168.254.220] Address N7:0/10 has value true and quality OK
[80007,781217410] Item Datatype (single value) is X and BO is -1
[80007,781290283 192.168.254.220] Address N7:0/11 has value false and quality OK
[80007,781368819] Item Datatype (single value) is X and BO is -1
[80007,781442448 192.168.254.220] Address N7:0/12 has value true and quality OK
[80007,781494176] Item Datatype (single value) is X and BO is -1
[80007,781545149 192.168.254.220] Address N7:0/13 has value true and quality OK
[80007,781596123] Item Datatype (single value) is X and BO is -1
[80007,781668241 192.168.254.220] Address N7:0/14 has value true and quality OK
[80007,781740736] Item Datatype (single value) is X and BO is -1
[80007,781805302 192.168.254.220] Address N7:0/15 has value false and quality OK
[80007,781871001 192.168.254.220] We are calling back our readDoneCallback.
[80007,782219131 192.168.254.220] Preparing to WRITE N7:0
[80007,782332405 192.168.254.220] Clearing write PacketTimeouts
[80007,782391685] WPAL is 1
[80007,782453230] AddrInfo WriteBuffer[0] is 204
[80007,782505337] The returned buffer length is 8
[80007,782665808 192.168.254.220] Sending Write Packet With Sequence Number 1099
[80008,259965670 192.168.254.220] Reading All Items (readAllItems was called)
[80008,266593718] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80008,366932709 192.168.254.220] Reading All Items (readAllItems was called)
[80008,367277440] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80008,468033659 192.168.254.220] Reading All Items (readAllItems was called)
[80008,468753327] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80008,570274901 192.168.254.220] Reading All Items (readAllItems was called)
[80008,570651348] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80008,671294293 192.168.254.220] Reading All Items (readAllItems was called)
[80008,671765891] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80008,771845107 192.168.254.220] Reading All Items (readAllItems was called)
[80008,772233637] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80008,872756888 192.168.254.220] Reading All Items (readAllItems was called)
[80008,873115212] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80008,973642617 192.168.254.220] Reading All Items (readAllItems was called)
[80008,974050026] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,74378445 192.168.254.220] Reading All Items (readAllItems was called)
[80009,74780946] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,183498449 192.168.254.220] Reading All Items (readAllItems was called)
[80009,184213964] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,292889177 192.168.254.220] Reading All Items (readAllItems was called)
[80009,294176727] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,402539681 192.168.254.220] Reading All Items (readAllItems was called)
[80009,404716810] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,511741997 192.168.254.220] Reading All Items (readAllItems was called)
[80009,512739942] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,613840136 192.168.254.220] Reading All Items (readAllItems was called)
[80009,614219605] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,727567754 192.168.254.220] Reading All Items (readAllItems was called)
[80009,728686148] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,836839545 192.168.254.220] Reading All Items (readAllItems was called)
[80009,837775567] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80009,949111968 192.168.254.220] Reading All Items (readAllItems was called)
[80009,949624722] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80010,58712254 192.168.254.220] Reading All Items (readAllItems was called)
[80010,59780429] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80010,167405969 192.168.254.220] Reading All Items (readAllItems was called)
[80010,167995372] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80010,276762715 192.168.254.220] Reading All Items (readAllItems was called)
[80010,278128046] Waiting to read for all R/W operations to complete. Will re-trigger readAllItems in 100ms.
[80010,283942785 192.168.254.220] PacketTimeout called with type write and seq 1099
[80010,285576576 192.168.254.220] WRITE TIMEOUT on sequence number 1099
[80010,292997165] No communication to PLC.
[80010,296393502] Stopping Processing Write Response Packet due to unrecoverable packet error
[80010,296850752] Time is 2 seconds and 514.4 ms.
[80010,297983871] N7:0 write completed with quality OK
[80010,384913092 192.168.254.220] Reading All Items (readAllItems was called)
[80010,385468513 192.168.254.220] Calling SRP from RAI
[80010,385843828 192.168.254.220] SendReadPacket called
[80010,386113043] The A2 Returned Buffer is:
[80010,386305986] <Buffer a2 02 07 89 00 00>
[80010,386621266] The returned buffer length is 6
[80010,386760971] The PCCC Encapsulation Header is:
[80010,386908605] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[80010,387225395] The Returned buffer is:
[80010,387427400] <Buffer a2 02 07 89 00 00>
[80010,387755140] Sending Read Packet SEQ 2
[80012,892601008 192.168.254.220] PacketTimeout called with type read and seq 2
[80012,894125300 192.168.254.220] READ TIMEOUT on sequence number 2
[80012,894627482 192.168.254.220] ReadResponse called
[80012,895165535] Timeout error - zero length packet
[80012,895680554 192.168.254.220] Read Time is 2 seconds and 509.6 ms.
[80012,896215586 192.168.254.220] Every packet done sending
[80012,897293201 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[80012,898181270 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[80012,898754815 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[80012,899310613 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[80012,899853574 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[80012,900523779 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[80012,901234763 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[80012,901642173 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[80012,902089605 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[80012,902543835 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[80012,903003728 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[80012,903454559 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[80012,903917472 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[80012,904349802 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[80012,904708504 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[80012,905036621 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[80012,905342461 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[80012,905649057 192.168.254.220] We are calling back our readDoneCallback.
[80012,905944702 192.168.254.220] Reading All Items (readAllItems was called)
[80012,906242991 192.168.254.220] Calling SRP from RAI
[80012,906536748 192.168.254.220] SendReadPacket called
[80012,906742907] The A2 Returned Buffer is:
[80012,906790482] <Buffer a2 02 07 89 00 00>
[80012,906853161] The returned buffer length is 6
[80012,906899603] The PCCC Encapsulation Header is:
[80012,906946046] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[80012,906998529] The Returned buffer is:
[80012,907043839] <Buffer a2 02 07 89 00 00>
[80012,907205443] Sending Read Packet SEQ 2
11 Oct 11:58:32 - [error] [pccc endpoint:6eddab8f.7d6114] Failure (Bad values)
[80013,915338904 192.168.254.220] Preparing to WRITE N7:0
[80013,916311929 192.168.254.220] Clearing write PacketTimeouts
[80013,916832613] WPAL is 1
[80015,408356686 192.168.254.220] PacketTimeout called with type read and seq 2
[80015,409341038 192.168.254.220] READ TIMEOUT on sequence number 2
[80015,409863987 192.168.254.220] ReadResponse called
[80015,410387314] Timeout error - zero length packet
[80015,410859290 192.168.254.220] Read Time is 2 seconds and 504.1 ms.
[80015,411340705 192.168.254.220] Every packet done sending
[80015,411981081 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[80015,412533481 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[80015,413165174 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[80015,413654140 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[80015,414147638 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[80015,414636605 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[80015,415062138 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[80015,415408379 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[80015,415704025 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[80015,415996272 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[80015,416270395 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[80015,416560000 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[80015,416837521 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[80015,417127126 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[80015,417408801 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[80015,417595325 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[80015,417712753 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[80015,417762971 192.168.254.220] We are calling back our readDoneCallback.
[80015,417816965 192.168.254.220] Reading All Items (readAllItems was called)
[80015,417867183 192.168.254.220] Calling SRP from RAI
[80015,417914381 192.168.254.220] SendReadPacket called
[80015,417974039] The A2 Returned Buffer is:
[80015,418023124] <Buffer a2 02 07 89 00 00>
[80015,418085425] The returned buffer length is 6
[80015,418133000] The PCCC Encapsulation Header is:
[80015,418178687] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[80015,418233059] The Returned buffer is:
[80015,418278746] <Buffer a2 02 07 89 00 00>
[80015,418461117] Sending Read Packet SEQ 2
11 Oct 11:58:34 - [error] [pccc endpoint:6eddab8f.7d6114] Failure (Bad values)
[80017,927725432 192.168.254.220] PacketTimeout called with type read and seq 2
[80017,929182138 192.168.254.220] READ TIMEOUT on sequence number 2
[80017,929600119 192.168.254.220] ReadResponse called
[80017,929936921] Timeout error - zero length packet
[80017,930235965 192.168.254.220] Read Time is 2 seconds and 512.3 ms.
[80017,931390228 192.168.254.220] Every packet done sending
[80017,933046296 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[80017,933941539 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[80017,935116192 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[80017,936327848 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[80017,941641161 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[80017,942277761 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[80017,942716132 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[80017,942981194 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[80017,943199058 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[80017,943427116 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[80017,943746927 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[80017,944073534 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[80017,944283469 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[80017,944591197 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[80017,944822276 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[80017,945002760 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[80017,945196458 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[80017,945344848 192.168.254.220] We are calling back our readDoneCallback.
[80017,945534393 192.168.254.220] Reading All Items (readAllItems was called)
[80017,945763962 192.168.254.220] Calling SRP from RAI
[80017,945964080 192.168.254.220] SendReadPacket called
[80017,946220457] The A2 Returned Buffer is:
[80017,946516480] <Buffer a2 02 07 89 00 00>
[80017,946746049] The returned buffer length is 6
[80017,946993741] The PCCC Encapsulation Header is:
[80017,947169694] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[80017,947418897] The Returned buffer is:
[80017,947654507] <Buffer a2 02 07 89 00 00>
[80017,948211061] Sending Read Packet SEQ 2
11 Oct 11:58:37 - [error] [pccc endpoint:6eddab8f.7d6114] Failure (Bad values)
[80020,456385678 192.168.254.220] PacketTimeout called with type read and seq 2
[80020,459167691 192.168.254.220] READ TIMEOUT on sequence number 2
[80020,459737083 192.168.254.220] ReadResponse called
[80020,460274002] Timeout error - zero length packet
[80020,460700290 192.168.254.220] Read Time is 2 seconds and 514.5 ms.
[80020,461212667 192.168.254.220] Every packet done sending
[80020,461803203 192.168.254.220] Address N7:0/0 has value false and quality BAD 255
[80020,462413751 192.168.254.220] Address N7:0 has value 0 and quality BAD 255
[80020,463025809 192.168.254.220] Address N7:0/1 has value false and quality BAD 255
[80020,463639754 192.168.254.220] Address N7:0/2 has value false and quality BAD 255
[80020,464238597 192.168.254.220] Address N7:0/3 has value false and quality BAD 255
[80020,464849522 192.168.254.220] Address N7:0/4 has value false and quality BAD 255
[80020,465482725 192.168.254.220] Address N7:0/5 has value false and quality BAD 255
[80020,466015868 192.168.254.220] Address N7:0/6 has value false and quality BAD 255
[80020,466541460 192.168.254.220] Address N7:0/7 has value false and quality BAD 255
[80020,466992669 192.168.254.220] Address N7:0/8 has value false and quality BAD 255
[80020,467341176 192.168.254.220] Address N7:0/9 has value false and quality BAD 255
[80020,467650414 192.168.254.220] Address N7:0/10 has value false and quality BAD 255
[80020,467949836 192.168.254.220] Address N7:0/11 has value false and quality BAD 255
[80020,468249257 192.168.254.220] Address N7:0/12 has value false and quality BAD 255
[80020,468546413 192.168.254.220] Address N7:0/13 has value false and quality BAD 255
[80020,468853763 192.168.254.220] Address N7:0/14 has value false and quality BAD 255
[80020,469158471 192.168.254.220] Address N7:0/15 has value false and quality BAD 255
[80020,469466576 192.168.254.220] We are calling back our readDoneCallback.
[80020,469759579 192.168.254.220] Reading All Items (readAllItems was called)
[80020,469995189 192.168.254.220] Calling SRP from RAI
[80020,470189266 192.168.254.220] SendReadPacket called
[80020,470347472] The A2 Returned Buffer is:
[80020,470394669] <Buffer a2 02 07 89 00 00>
[80020,470459236] The returned buffer length is 6
[80020,470506433] The PCCC Encapsulation Header is:
[80020,470553631] <Buffer 4b 02 20 67 24 01 07 00 00 01 02 03 04 0f 00 12 34>
[80020,470605737] The Returned buffer is:
[80020,470652934] <Buffer a2 02 07 89 00 00>
[80020,470847766] Sending Read Packet SEQ 2
11 Oct 11:58:39 - [error] [pccc endpoint:6eddab8f.7d6114] Failure (Bad values)

from node-red-contrib-pccc.

plcpeople avatar plcpeople commented on July 18, 2024

I finally had a look at this and I think that somehow when Node-RED 1.0.0 was installed and all your packages were "updated", node-red-contrib-pccc (or something somehow) may have installed an older version of nodePCCC. You should be at 0.1.16. I can tell from this log that it doesn't even have the very first modification that was done to reset the connection on a packet timeout.

@gfcittolin assuming I'm not wrong about this, why would a new install not have installed the latest?

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

Yes, I had to copy the "package.json" and "nodePCCC.js" files from the website again to my "C:\Users\myname.node-red\node_modules\nodepccc" folder this morning. It's actually working great again. Thanks for your look at this. Is this because I just copied the files before and did not install the system as a unit?

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

For some strange reason my system must have updated "node-red-contrib-pccc" node. The files in my C:\Users\myname.node-red\node_modules\nodepccc\nodePCCC.js and package.json were from an older version today when I started my system. I copied the files from nodePCCC again today. How do I prevent this from overwriting newer files with old ones?

from node-red-contrib-pccc.

gfcittolin avatar gfcittolin commented on July 18, 2024

How do I prevent this from overwriting newer files with old ones?

That's on me. I've just published a new version of the node with the dependency updated to the latest nodepccc version. Besides this and many other UI improvements, the connection handling has been improved, there were some edge cases where a failure when connecting to the PLC would not trigger a reconnection.

I hope that everything should be now fixed! Could you maybe try to install the node on a clean installation and check if everything is working as expected?

P.S.: Thank you so much @plcpeople for your help!

from node-red-contrib-pccc.

youngkzy avatar youngkzy commented on July 18, 2024

@gfcittolin, Thank you for the time and energy spent on this node. The project I'm starting will benefit from it because we still use Micrologix and SLC5/05 PLC's. Although, I still need to hook up an SLC to test it on... I still get multiple errors "Failure (Bad values)", my test configuration is using the "Status" node to re-inject the last value stored in a variable, and it resumes working. I am not sure if this problem is something you can address. Maybe sketchy hardware... etc... But I was wondering if it would be any benefit to use the "Catch" to trap the error vs. the "Status". That's not a "need". Thanks again for everything.

I will try to install it on the "clean" Windows 10 system shortly. Maybe this month. I'll keep you posted. I'll close the issue after I test it further on the SLC and new install.

from node-red-contrib-pccc.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.