from the Stuck On This department...
Embedded Modbus Slave Response
Engineering and workplace issues. topic
Posted by criders on 18 October, 2009 - 3:19 pm
Hello All,

I am working on an embedded device that will communicate to stuff via RS232 / RS485 port. As of today, I am able to get the data from a PC to the embedded device. I am now in the process of trying to decipher the data to find out if data is correct and the correct response to transmit. I know to do the following:

1.) check the data length : data > than 3 bytes
2.) check parity, overrun
3.) check crc
4.) check data address, function
5.) check modbus address
6.) update counters

I have two questions...

1.) Is there a specific order to check the modbus data to see if it is correct?

2.) Is there anything that I forgot?


Posted by M Griffin on 18 October, 2009 - 9:58 pm
Yes the order in which you check things matters. There are flow charts and state diagrams in the Modbus specs which specify the order in which things are to be checked. You should be following the order specified, as the same problem may result in a different error if checked in a different order, which will cause difficulties for anyone trying to troubleshoot communications problems.

If you are doing Modbus over serial lines, then at the very least you will need the spec for the serial communications (Modbus Over Serial Line), and the spec which describes each function (Modbus Application Protocol).


Posted by criders on 19 October, 2009 - 2:19 pm
> Yes the order in which you check things matters. There are flow charts and state diagrams in the Modbus specs which <

Cool beans.
Thanks a lot. It looks like I was following the flowchart from the serial communications.

Your use of this site is subject to the terms and conditions set forth under Legal Notices and the Privacy Policy. Please read those terms and conditions carefully. Subject to the rights expressly reserved to others under Legal Notices, the content of this site and the compilation thereof is © 1999-2010 Nerds in Control, LLC. All rights reserved.

Users of this site are benefiting from open source technologies, including PHP, MySQL and Apache. Be happy.


Fortune
Beware of the Turing Tar-pit in which everything is possible but
nothing of interest is easy.