kueblele
I am currently working on a project as a student, where I am supposed to connect my Raspberrry Pi 4B running OpenPLC_v3 as a Modbus Master to an Arduino Uno, running a basic script based on the example for the Arduino as a Slave.
I have successfully used Modbus with basic connection between the two devices using TX to RX and RX to TX cables.  (I had to change hardware-setup of openplc runtime to blank(linux) and was using AMA0 (RP4 GPIO pins 14 and 15). To my knowledge this limits my setup to a point to point connection. 
Because I would like to be able to connect more bus devices to the bus, I want to implement RS485 using the MAX485ESA. 
 
Now my question is, how to connect a MAX485ESA shield to the Raspberry Pi. 
The problem I am facing is, that you need a third pin next to RX and TX on the Raspberry Pi for the DE/*RE pin on the MAX485ESA. I do not know where to connect this pin and if this option to set up RS485 exists like this in OpenPLC.

What I DID manage to do so far though is use a USB to RS485 transceiver, which I plugged in to the RP4 and connect the transceivers RS485 pins to the Arduino. That worked well. But I don't see, how I can use standard AMA0 with a RE/*DE pin.
🙁

Thank you for your input in advance!
Reply 0 0
thiagoralves
OpenPLC does not support RS485 on the Raspberry Pi, so your only option is to use the USB transceiver. Another option, if you plan on using plain Arduinos, is to connect them all to a USB hub. You will still have a point to point connection to each Arduino, but you will be able to connect to all of them at once.
Reply 0 0
richw
If you search Amazon they sell a TTL to RS485 module with automatic flow control which automatically controls the DE/RE pin. I've used these at 9600bps and they work quite well
Reply 0 0
Reply