plcpeople / nodeS7

Node.JS library for communication to Siemens S7 PLCs
MIT License
356 stars 120 forks source link

"<Unknown error code>" on getSSL() related to not supported SSL on PLC? #111

Closed flacohenao closed 4 years ago

flacohenao commented 4 years ago

Hi Guilh,

I swaped the PLC for testing and... when I was requesting for the .getComponentIdentification() i got this error:

Error: Unexpected error code reply on userdata response [54273]: "<Unknown error code>"
    at S7Connection.sendUserData (C:\Users\ACER\Documents\NODE PROJECTS\tot-bend\node_modules\nodes7\src\s7connection.js:461:23)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at S7Endpoint.getSSL (C:\Users\ACER\Documents\NODE PROJECTS\tot-bend\node_modules\nodes7\src\s7endpoint.js:916:19)     
    at S7Endpoint.getComponentIdentification (C:\Users\ACER\Documents\NODE PROJECTS\tot-bend\node_modules\nodes7\src\s7endpoint.js:1003:23)

I wonder if this is an error that is thrown due to what you mention on the docs:

Gets and parses the 0x001c SSL ID that contains general information about the device and the installation This may not be supported by the PLC. In this case, an error is thrown

The CPU is actually not that old: 6ES7 214-1AG40-0XB0

I couldn't figure if its actually not supported and as we discussed its something that we need to manage in the .catch() in order to not to make that function a "function hell" OR if its actually an error..

let me know!

gfcittolin commented 4 years ago

So, SSL is something mainly of S7-300/400 series... the S7-1200/1500 have a very different internal architecture, they even have a "newer" protocol, and many things on the classic protocol (the one we're talking about here) are not supported or are just partially supported on these PLCs.

If you want to confirm whether it's supported or not, you can call getAvailableSSL() and check if the number 28 (0x001c) is in the list.

flacohenao commented 4 years ago

Thanks!!