Problem of interface 8051 with device via Modbus RTU

C

Thread Starter

control management

Hello guys;

I can't make correct interface between 8051(AT89S51) with flow processor device via modbus. I wrote a small code with Keil software to generate RTU modbus protocol for 8051. although transfer data from 8051 to device is ok but receive data is not ok.

because for example
when microcontroller poll command to change kilogram unit of device to gram unit, device change unit correctly. but response frame is shown on LCD is not ok, why!?

poll frame is: 01 06 00 83h 00 3ch 78h 33h
response frame have to be: 01 06 00 83h 00 3ch 78h 33h
but in best condition (when baudrate = 4800 scon = 40h)
response frame is: 01 00 83h 00 3ch 78h 33h

also according to attached code this interface is checked for three different poll command. the schematic is attached too. it's citable, interface between PC and flow processor with

simply_modbus software and

2)VB6 program {if DTREnable=true} is tested and that's working fine.

www.edaboard.com/attachments/93663d1374010104-8051_modbus_rtu.txt

www.edaboard.com/attachments/93662d1374009831-shematic.pdf

Best Regards,
Elhamifard

<b>Moderator's note:</b> To see these attachments, you have to register with edaboard.
 
Top