Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
471 stars 175 forks source link

Version 3 Announcement #133

Closed stefanpoeter closed 6 years ago

stefanpoeter commented 7 years ago

Hi all,

i've reimplemented this module to address some issues that were coming up from time to time and to get rid of some dependencies. You can have a look at the code on the v3.0.0-alpha branch. The code follows strictly the composition over inheritance pattern and doesn't use stampit anymore. Have a look in the Readme on that branch for some more informations and give me some feedback. The Server isn't yet implemented.

Thanks, Stefan

stefanpoeter commented 7 years ago

I've made some progress here. The TCP and RTU Client are already complete, unfortunatly there is an issue with the serialport implementation and ubuntu where I cannot send or receive information. I compared the rtu output for all requests, it looks fine, I just couldn't test it. Is anyone out there who wants to try the rtu client?

koalex commented 7 years ago

Is it planned to release a stable version?

stefanpoeter commented 7 years ago

It is supposed to be a stable version. I am looking for people to test it. Would be happy if you do. :-)

profelec commented 7 years ago

But the Server isn't yet implemented.

profelec commented 7 years ago

Hi, Is it planned to release the server? thanks for your job ;-)

stefanpoeter commented 7 years ago

Well yes, it comes with a server and a client. There is still some work that needs to be done, any help yould be appreciated.

profelec commented 7 years ago

I do not understand this line, in jsmodbus/src/tcp-server-request-handler.js : this._buffer = Buffer.compose([this._buffer, data]) "compose" does not exist

stefanpoeter commented 7 years ago

This should be Buffer.concat([this._buffer, data]). This code is probably untested yet.

profelec commented 7 years ago

the server does not crash anymore, but the client shows me this:

Automate connected.
Unhandled rejection (<{"err":"timeout"}>, no stack trace)

Client closed, stopping interval.
Automate connected.
Unhandled rejection (<{"err":"timeout"}>, no stack trace)

Client closed, stopping interval.
stefanpoeter commented 7 years ago

The tcp server response handler only handles read coil requests by now. Have a look at the tcp-server-repsonse-handler.js file. Implementing other FCs shouldn't be so hard.

AnthonyMujic commented 6 years ago

I find this version really intuitive - great work. I don't have a serial port on my computer so I don't think I can help testing the RTU Client, but I would love to work on the TCP Server. Is it as simple as making pull requests, or is there someone I should get in contact with first?

stefanpoeter commented 6 years ago

Great to hear, you can simply make pull requests.