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