Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[AVR] Improper Respose from Slave..

Status
Not open for further replies.

Maverick_391

Newbie level 3
Joined
May 18, 2012
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pune, India
Activity points
1,312
Hello Friends,

I need some help from you all in MODBUS protocol implementation through RS-485.

I am getting some weird type response from a slave (energy meter of reputed make) though I send proper query through PC Modscan32 software. I am herewith attaching a snapshot of respective image. Please try to find some time to help me out because my stuck now and not getting any enough help around.

Query : 01 04 00 00 00 06 78 1F
Response : 01 10 68 C5 BA D6 C9 9E 5428 D5 D0 D7
(function code 0x10 !!! actually I was expecting 0x04!! why this???)
 

hello,


it seems than return code 10h => 16 Return Slave NAK Count
if your device support all modbus protocole

ModiconModbus Protocol
Reference Guide
Maybe you can do some test with QUERY DATA loopback

Query
Here is an example of a request to slave device 17 to Return Query Data. This
uses a subfunction code of zero (00 00 hex in the two–byte field). The data to be
returned is sent in the two–byte data field (A5 37 hex).
Example
Field Name (Hex)
Slave Address 11
Function 08
Subfunction Hi 00
Subfunction Lo 00
Data Hi A5
Data Lo 37
Error Check (LRC or CRC) ––

and response


Response
The normal response to the Return Query Data request is to loopback the same
data. The function code and subfunction code are also echoed.
Example
Field Name (Hex)
Slave Address 11
Function 08
Subfunction Hi 00
Subfunction Lo 00
Data Hi A5
Data Lo 37
Error Check (LRC or CRC) ––
 
Thank u for reply.

I am going to check the said loop back test. Beforeion that i need to mention that if I send MODBUS query over USB to RS485 converter then Slave shows exact response but when I send it through RS232 to RS485 conerter of different make then I gets the improper response i.e Function code 0x10 (16 in decimal).

Is this direction pin's (DE/ RE) issue of MAX 485??
 

is it a true RS485 mono paire or like RS422 2 paires, one for transmit one for receive..
RS232 must manage RS485 protocole (some silence to manage..etc..) .It is not only hardware signal conversion
common mode to differential mode..

How is made your hardware RS232/RS485
is it an industrial interface ? or just level translator devices.

What about the cable length and load on the RS485 bus .. terminal resistor value.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top