Modbus RTU implementation

R

Thread Starter

rahul

I am trying to implement communication between 8051 processor and Hitachi L200 VFD inverter. I am sending this message frame using RS485 communication:

01 06 00 01 01 00 D9 9A

but I am getting this response from the inverter:

01 D9 9A 51

It does not match with any of the exception response mentioned in Modbus implementation. I am using baud rate 4800, no parity and 1 stop bit and slave address is set to 1. I would appreciate if anyone could tell me what is going wrong.
 
I'm stumped too. One would expect a lega response like 86 01 A2 10

Exception response to function 06 = 86
01 = Illegal Function: the message received is not an allowable action for the addressed device
(or some other 0n exception code)
A2 10 = [CRC CRC]

I ran my CRC calculation for 01 D9 and got different CRC, 0xBAC1, which would produce a response of 01 D9 C1 BA, if a D9 exception code were legal, which it isn't.

Typically, slaves do not return an exception code if they encounter a comm error, like no parity with only one stop bit, or wrong baud rate, letting the master time out. But this slave is making it on his own here.

You got me.

David
 
If you're using a 2-wire RS485 setup, then its possible that your transmitted query is being echoed to your receiver. Most 485 implementations have settings to disable the receiver when transmitter is enabled.

What type of transmitter and receiver control does the 485 port have (RTS, Send Data, etc.)?

Does the UART support buffered comms?

How are you capturing what is being sent over the wire?

To isolate problem to master or slave, you should try a known working Modbus Master to see if you get the same result:

http://automatedsolutions.com/products/modbusrtu.asp

-Mark
http://automatedsolutions.com
 
Top