mathiask88 / node-snap7

node.js wrapper for snap7
MIT License
163 stars 59 forks source link

List of possible Errors! #65

Closed flacohenao closed 4 years ago

flacohenao commented 4 years ago

I understand that all the errors that the client/server emits, are being reported and we can log them out.

I.E. Connection failed. Code #665420 - ISO : An error occurred during recv TCP : Connection timed out

But... for being more user friendly with those errors, can you provide a list of the posible codes that we can find and what do they mean?

mathiask88 commented 4 years ago

You can have a look into the Snap7 documentation, because this is a wrapper for that library. There you will find this description image

ISO error codes https://github.com/mathiask88/node-snap7/blob/master/src/snap7.h#L181-L195 S7Client error codes https://github.com/mathiask88/node-snap7/blob/master/src/snap7.h#L234-L271 S7Server error codes https://github.com/mathiask88/node-snap7/blob/master/src/snap7.h#L546-L553

These codes are also populated on a client/server instance

const snap7 = require('node-snap7');

const s7client = new snap7.S7Client();
console.log(s7client.errCliInvalidPlcAnswer)

The ErrorText() function demasks this error code composition and returns a textual representation of each field (S7/ISO/TCP)

flacohenao commented 4 years ago

Thank you!!!