Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to buffer serial data. #2

Closed
brycheiniog opened this issue Dec 22, 2015 · 5 comments
Closed

Need to buffer serial data. #2

brycheiniog opened this issue Dec 22, 2015 · 5 comments

Comments

@brycheiniog
Copy link

Hi,

I just tried running v3.2.5 of the package in ModbusRTU mode against this Modbus Simulator: http://www.plcsimulator.org/

When I try and run the simple logger example, I get loads of errors about the Data Length not being what is expected (See line 192 of index.js).

This is happening because the serialport module is passing you data as it gets it from the far end and not waiting.

One option would be to configure the serialport module to wait for a delimiter before triggering the 'data' event, but from a quick look at the modbus protocol I don't think that is possible. If that is the case then I think the correct solution is to buffer the data up until you have the expected length and then attempt to process it.

@yaacov
Copy link
Owner

yaacov commented Dec 23, 2015

@brycheiniog
Copy link
Author

Great, that has fixed the issue I was seeing.

Thanks!

@yaacov
Copy link
Owner

yaacov commented Dec 23, 2015

:-)

@brycheiniog
Copy link
Author

Are you going to release a new version of the package?

Thanks

@yaacov
Copy link
Owner

yaacov commented Dec 23, 2015

v3.3.5 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants