Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
456 stars 169 forks source link

Where is API? #260

Closed JianJD closed 4 years ago

JianJD commented 4 years ago

Is there an API document for this?

stefanpoeter commented 4 years ago

Hi @JianJD ,

by now there is only the readme. A detailed API documentation is still on my bucket list.

JianJD commented 4 years ago

When can you finish this API document?I really need your package now !!!Thank you

stefanpoeter commented 4 years ago

The readme deals with the basics for this library and it should be no problem to go on from there.

However, if you want to participate in this free and open library then you are welcome to commit a more detailed documentation yourself.

JianJD commented 4 years ago

Does this package have CRC verification?

stefanpoeter commented 4 years ago

Modbus/RTU uses CRC verification and so does this package. Modbus/TCP does not since it is part of TCP.

jacobq commented 4 years ago

The server examples don't appear to show how to handle any requests. Am I missing something / not looking in the right place? For example, how can I make a server that responds to a readCoils request from the client in the other example?

EDIT: found a little more here:https://github.com/Cloud-Automation/node-modbus/blob/master/examples/tcp/SimpleServer.js

It would be nice to update the one in the README or just put a link...would you take a PR for this?

EDIT 2: Looks like there are also some mistakes in the examples :( For example, in the client resp.response.body.coils is undefined but resp.response.body._valuesAsArray has the expected bits.

stefanpoeter commented 4 years ago

Hey @jacobq

of course I take a PR for this.