Modbus rs485 half duplex turnaround

I need a way to be informed when a transmission to the client has completed on the wire so that I can disable the transmitter in my rs232/rs485 transceiver chip. Is there an obvious way to do this that I have missed? I am using node-red-contrib-serial-modbus, that uses modbus-serial, which in turn, uses serialport. It looks I can get a callback from serialport. However as far as I can see this is not used by the parent nodes.
Before I start hacking code. Has anyone any experience of this they can share. Or even better some code.

Thanks

I'm using always an Usb to RS485 chip that handle this by themself in hardware.
Then you don't need change code etc to enable or disable the transmitter.

For example have a look at this FTDI chip on page 26.

Most of the FTDI chips can drive the Rs485 this way.

I haven't used RS485 for decades, but since no-one else has offered any suggestions, does that chip have an automatic mechanism for driving the output based on what you send it (if I remember correctly it was XON/XOFF that did it, or something like that).

It's based on x time after the last stop bit the transmitter will be switched off.

I am afraid that that is not an option in this case. The asynchronous hardware is being provided by the broadcom SOC on a raspberry pi. This is driving pins on the gpio header that are connected to a custom pcb that contains the 485 convertor.

In that case I suggest your hardware is not fit for purpose.

1 Like

Not down to me I am afraid. The customer has specified what should be on the board. It has a max487 as the transceiver chip. If I can hack modbus-serial to give me a callback on the write completion, then modify the prototype board they have given to separate out the tx and rx enable lines and turn the tx off, the world will be happy.

Maybe you can use this node node-red-contrib-serialport-rs485 in combination with the modbus node or maybe there's a other mod bus node that you can connect to it.

I have hacked the bottom end of node-modbus-serial to manage the tx and rx enable pins on rs485 transceiver. I am hoping that will do the trick.