XBee RS-485 Adapter


I got the following:

PC –> bus (wire) RS-485 (modbus protocol) –> xbee
to adapter digital

but,this is possible?

Data–>bus RS-485 (modbus protocol)–>xbee



I am not sure of your question.

Are you asking - can a remote RS-485 device talk to a PC via the XBee 485 adapter and a 2nd XBee?

If the design is that simple, then yes. You’d need the “AT Router” firmware on both, plus set the DH/DL settings to each points to the other. This way, everything your external device says is echoed to the PC, and anything the PC says in returns is returned back to the device.

Be aware that time-gaps might appear in the Modbus because the XBee can only move from 80 to 100 bytes per packet (depends on the technology used - ZigBee or 802.15.4)

If you want many remote devices to talk to the PC, you’ll need at least the PC-based software to be smart enough to use API mode and ‘address’ the responses to the many MAC addresses be used by the remote devcies.

I have the next frame
7E 001A 1001 0013A200403AF5B7 FFFE 0000 00010000000603030FAB0001 4E

0013A200403AF5B7 is 64-bit destination address
00010000000603030FAB0001 is MODBUS/TC

and the reponse is

7E 0007 8B 01 5B19 000000 FF


5B19 is short address of end device.
Value of discovery status (byte 10) is 00 ( no discovery overhead) why?

I need to sent comand MODBUS/TC 000100000006 03 03 0FAB0001 for UART of adapter RS-485 to external device, that i would be reading tension value of 0FAB ( 4011) of external device.

03 is slave and this values are correct
03 value read in command MODBUS/TC.

I configure DH and DL how brodwcast in end device, D7=7 and D2=5.

how i read value of external device by RF data packet? Or what is the way?and an example of frame?


The “8B” response is the API Transmit Status Frame from the attached XBee. It doesn’t promise your end-device has seen the request - only that it passed on to another XBee. The “No Discovery Overhead” may be true because the gateway/coordinator already knew the 16-bit address. Just a guess by me.

If your RS-485 device recognized the packet, it would return a response and you’d see either a Frame Type 0x90 or 0x91 (depends on your A0 setting) with your Modbus response.

Since you are sending Modbus/TCP form, your RS-485 device will need to handle Modbus/TCP via RS-485 (does it?) and not Modbus/RTU. Are you sure you should not be sending Modbus/RTU instead?

If the RS-485 device is expecting Modbus/RTU, it will see your Modbus/TCP form as invalid and ignore it.

I tried the next frame in MODBUS/RTU:

7E 0016 10 01 0013A200403AF5B7FFFE 0000 03 03 0FAB 0001 CRC Checksum

Where CRC was for test diferent

CRC (1byte) 128 and checksum 2C
CRC-16 1F79 and checksum BD
CRC-16(MODBUS)1D1D and checksum 1B

And the response was the same that MODBUS/TCT.
7E 0007 8B 01 440D 000000 22

I need get a value of PM (power meter or centrale of mesure) by bus RS-485 that is be coneccted to adapter RS-485.

Frame I am to send to adapter by pc

And PM (power meter or centrale of mesure) only can read modbus protocol but manual Xbee said that frame type: (0x90)
“When the module receives an RF packet, it is sent out the UART using this message type.” which is not MODBUS/RTU o MODBUS /TCT according to the manual.

If I send api 0x10 to adapter, I will receive api 0x90 with value of PM desired?


The ‘8B’ frame is what you want. I assume you see no response because either the XBee in the RS-485 adpater is set up wrong, or the RS-485 meter is not responding.

Are your DH/DL registers correct in the 2 XBee?

Is your meter seeing the request?

Is your meter returning a RS-485 response?

If your meter responds, and if your XBee are set up correctly, then you will receive either a 0x90 or 0x91 frame (depends on AO setting).