Connect RS485 by PS9600 Communication Issue

Hi every one
I am new at B&R, so I am trying to connect RS485 with 3rd party py PS9600 with BB53 but I have error code with MBMaster which is “65535” when EventPV = True.

I share with you my logic

I share with you my error

Hello, 65535 is no error - this status means “busy” or in other words the function block is currently working/executed

Looking at your code you are calling the funtion block in the cyclic part of the task without any condition

This means it is executed every cycle → resulting in “busy” every cycle
It is okay to call this function block and as you do not get any error code back I suppose your modbus is fine and running

Thanks for reply
what about this sttus code"20220" it apear also with “65535”

how I can troublshooting the communication because it is connected with 3rd party device but the data does not communicated.
The “S” led at PS9600 is flashed onse every 2 sec.

So you also get 20220 and not only “busy”

20220 means “timeout” or in other words a connection problem to the slave
Either the slave is not responing at all or it takes too long to receive its answer.
First thing is to check if the slave is even reachable. Here you have to check wiring and adress of the slave
If it is then the used function codes / adress for modbus might be wrong

I actualy use Modbus bool with USB-RS485 Converter not real device

It is slave configuration

it is Master Configuration

image

The dataobject you handle tothe MbMopen function block defines your modbus functions and adresses.
B&R Online Help (br-automation.com)


So either the slave does not fit to the masters configuzraiton object or the slave is not reachable
I am sorry but I have never used this software nor a USB to RS485 converter

can you help me to deactivate the “flow control” for this serial communication

I am sorry but I am a bit lost now - why do you want to deactive this ?

The RXD led at converter is open so the converter recive the data from PLC but not responded so I suppose may be the flow control can impact on the communication

If the RxD is lit then the modbus master tries to establish communication and if you then get 20220 it would mean that the slave does not respond.
I am no RS485 expert but I doubt that flow control is the problem here. I rather think the slaves settings (in terms of modbus) are incorrect

is configure the slave ID at “Pconfig” function only ? or Slave ID is configure at another place?

if it is configure at Pconfig only, is it OK, MBOpen not give error even intialize the PLC (when enabbled) and MBClose give same error “20220” when enabled ?

The dataobject you hand over to “pConfig” is the one describing the slave
The content of this dataobject must fit to the slave as otherwise you will get errors when the master tries to access the slave.

As mentioned I do not know the software you are using and cannot quote if it is correctly set in order to fit to the masters settings (in temrs of modbus registers and adresses)

Hi,

maybe I’m completely on the wrong track, but I would suggest to check again the physical connection first.

RS485 has to be terminated on both ends of the bus. Sometimes it works also without termination on short lines, but per definition a termination is mandatory.
X20BB module has a integrated terminating resistor, is it switched on? And has the USB device also a terminating resistor (if not, you can terminate the bus by connecting a 120 ohms resistor between the 2 data lines)?

In one of the screenshots I can see that you use a CH340 chipset based USB devices.
In past, I had some trouble using that chipset together with Windows 10/11 (I played around with arduino and ESP chips), because of the proprietary CH340 drivers. Therefore, I personally prefer devices with CP2102 or FT232L chipsets, since those chipsets are using the windows standard drivers - maybe you have the possibility to test a different converter not using CH340 chip?

Independent of the chipset, a USB serial converter device maybe use 3.3V signal voltage only, but industrial devices maybe expect higher signal voltages (I haven’t tested it, but I could imagine), even if RS485 is using a differential signal.

So if possible, could you try to use a 2nd PLC or comparable industrial device as modbus slave?

Best regards!

1 Like

Hi
I tried your suugestion for termination the communication cable and use anoter usp-Rs485 converter
but same errror

I tried to communicate the used converter with other devices, and it is work without any issue

Dears,
Thanks you all
my issue is solved by upgrade the firmware of X20CP0483 for latest version
BR.

2 Likes