tyrrellsystems / node-red-contrib-serial-modbus

This node is now maintained from @leifnel's fork
https://github.com/leifnel/node-red-contrib-serial-modbus
Apache License 2.0
7 stars 13 forks source link

Modbus communication stops if a read holding register request times out #13

Closed jonasgreen88 closed 7 years ago

jonasgreen88 commented 7 years ago

Hi,

When I used these nodes to communicate with a Modbus sensor the Modbus communication stops working (both read and write nodes) if a read request e.g. times out (only tested read holding register). It seems like the node tries to process the data even if there is not data. When an error occurs the data variable is undefined.

Attached a patch with a solution that solves this issue. I'm not sure if it is the best one though.

0001-Do-not-process-data-when-Modbus-request-fails.patch.zip

Best regards, Jonas.

hardillb commented 7 years ago

Thanks, for spotting this.

Any chance you can submit the patch as a proper github pull request then it can be reviewed properly and then merged.

jonasgreen88 commented 7 years ago

Yes, of course!

hardillb commented 7 years ago

I've just published version 0.0.9 which should include this patch. Thanks