CODESYS - the IEC 61131-3 automation software

RS485 read failure
Page 1 of 1

Author:  GiorgioT [ Mon Mar 20, 2017 11:31 am ]
Post subject:  RS485 read failure


I'm trying to communicate with a TOSHIBA inverter through RS485.
I use a SN75LBC184 (MAX485 equivalent) connected to RX/TX channels of the BBB through suitable 5v - 3.3v level shifters.
I decided to control the DE/RE pins of the MAX485 in hardware, without enabling RTS/CTS pins of the UART, by means of NE555 as explained here:
Unfortunately, Codesys returns RESPONSE_WRONG_SLAVE (see attachment) even if i'm always able to write the registers and spin the motor. Moreover the read function occasionally works fine and i can read the registers but the most of the time the read fails.

Then, i adapted the RS485 shield for Raspberry Pi : to work with the BBB but i get the same exact results as above.

I then tried that shield on a Raspberry Pi and I always read and wrote successfully all the registers.

I also loaded the overlay BB-UART4-RS485-00A0 to control directly the MAX485 DE/RE pins through the P9.27 pin but it does not work either. I couldn't see any signal from P9.27 using an oscilloscope.


Author:  boldive [ Tue Mar 21, 2017 1:18 pm ]
Post subject:  Re: RS485 read failure

you have declared Modbus_Slave under Modbus_Master. Under one port it can be Master or Slave, not both. I am not sure it this is the right way to do it.

Author:  GiorgioT [ Fri Mar 24, 2017 1:41 pm ]
Post subject:  Re: RS485 read failure

Hi, it should be the right way. My BBB is the master wired with N. slaves along the bus.
Anyway i solved using a MAX13488E with AutoDirection Control.


Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited