Page 1 of 1

Communication between Mitsubishi PLC and RPi via pymodbus

Posted: Wed Jul 15, 2020 9:32 am
by nightmareforev
Hello,
I have previously successfully read and wrote coils and registers in GOC, (https://mitsubishielectric.in/fa/fa-goc-plc-hmi.html) with RPi via Modbus TCP/IP using pymodbus.
Now, I am using a Raspberry Pi 3 B+ to establish communication with the FX5U PLC (http://www.atronika.com/Mitsubishi/PLC/ ... _users.pdf) from Mitsubishi via Modbus RTU. I connect an ethernet cable to my Pi's ethernet port on one side and map the outputs to match RS485 as shown in the following image by cutting the other end of the cable.
rj45-rs485.jpg
rj45-rs485.jpg (15.63 KiB) Viewed 120 times
If I were to use a USB RS485 converter, I would have opened the USB port for communication as in the example using,

Code: Select all

client= ModbusClient(method = "rtu", port="/dev/ttyUSB0",stopbits = 1, 
		bytesize = 8, parity = 'E' baudrate= 9600)
But since in the current case, I am using an ethernet port on one side and RS485 on the other, how to use pymodbus to initiate a client in Rpi?

Re: Communication between Mitsubishi PLC and RPi via pymodbus

Posted: Wed Jul 15, 2020 11:27 am
by trejan
nightmareforev wrote:
Wed Jul 15, 2020 9:32 am
I connect an ethernet cable to my Pi's ethernet port on one side and map the outputs to match RS485 as shown in the following image by cutting the other end of the cable.
You can't do that. The Ethernet port on the Pi is Ethernet only. It does not do RS485. You will need to buy a USB RS485 converter. The adapter photo is specific to the CU4-SOPRANO card which is just reusing the RJ45 socket itself for RS485.