# Modbus rs485 half duplex turnaround

**URL:** <https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134>\
**Category:** Industrial\
**Created:** [4 August 2020 13:08 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134 "2020-08-04T13:08:52Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerjames99](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogerjames99/32/25201_2.png) [@rogerjames99](https://discourse.nodered.org/u/rogerjames99)\
**Post date:** [4 August 2020 13:08 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/1 "2020-08-04T13:08:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [4 August 2020 14:49 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/2 "2020-08-04T14:49:43Z")

</div>

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](https://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_FT230X.pdf) chip on page 26.

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

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 August 2020 14:51 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/3 "2020-08-04T14:51:34Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [4 August 2020 15:07 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/4 "2020-08-04T15:07:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rogerjames99](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogerjames99/32/25201_2.png) [@rogerjames99](https://discourse.nodered.org/u/rogerjames99)\
**Post date:** [4 August 2020 15:33 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/5 "2020-08-04T15:33:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [4 August 2020 15:40 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/6 "2020-08-04T15:40:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rogerjames99](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogerjames99/32/25201_2.png) [@rogerjames99](https://discourse.nodered.org/u/rogerjames99)\
**Post date:** [4 August 2020 21:54 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/7 "2020-08-04T21:54:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [4 August 2020 22:22 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/8 "2020-08-04T22:22:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rogerjames99](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogerjames99/32/25201_2.png) [@rogerjames99](https://discourse.nodered.org/u/rogerjames99)\
**Post date:** [5 August 2020 21:44 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/9 "2020-08-05T21:44:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 October 2020 21:44 UTC](https://discourse.nodered.org/t/modbus-rs485-half-duplex-turnaround/31134/10 "2020-10-04T21:44:52Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
