BiancoRoyal/node-red-contrib-modbus

Support for sending raw modbus messages

brolaugh opened this issue · 5 comments

Describe the requested feature

I'm currently trying to use a relay in NodeRED using this lib but it appears that the relay that I'm using isn't 100% modbus compatible. However by sending the raw bytes on the modbus TTY (in a python script) I'm able to flip the relay and get CRC validated responses.
Here's an example of the of "modbus commands" that I send to close and open relay channel one.

0b 05 00 01 00 00

0b 05 00 01 FF 00

For me personally the alternative would be to entirely drop this lib start utilizing the exec nodes to control my relay which I'd rather not do.

Motivation

It appears that going outside of the modbus spec as been requested before and I guess this would be going a bit further than the previously mentioned feature request.

Hi @brolaugh or in your case you could give node-modbus-serial (modbus-serial npm) a try how it works with a simple script with that lib. If it works well and needs some special code, then you could give that lib as global lib into node-red via the settings file and use the function node of node-red to use your working code fragment inside node-red. Please, let me know if or how it works for you with that hint! Happy coding!

DEBUG=*modbus* node-red -v can show you what we send to the TTY and what you get back

You could also set the NODE_DEBUG env variable to include the regex of modbus see this article

Playing around a little with node-modbus-serial made me realize that I can just set each induvidual relay channel(coil) with separate commands and that way get around the modbus incompatible parts. Was unsuccessful in setting all the relay channels (coils) at once thought since that was incompatible with modbus.

This issue is stale because it has been open 60 days with no activity. It will be closed in 30 days, but can be saved by removing the stale label or commenting.