Member Login
member
passwd
remember me on this computer.

- join now -

Search

Neat Stuff

Visit our shop for nerds in control lifestyle products.

Cool stuff
Select a topic of interest:
...and press:
Fortune
Public use of any portable music system is a virtually guaranteed indicator
of sociopathic tendencies.
-- Zoso
RSS Feed
RSS feed Use this link to get an RSS feed of the Control.com article flow, for private, non-commercial use only:
www.control.com/rss
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
from the Electrical and Electronics Engg department...
Modbus RTU Framing
Software in Automation topic
advertisement
Posted by Prashob on 11 March, 2008 - 11:11 pm
I am trying to develop a c++ program for acting as a Modbus master (for data acquisition from power meter which works on Modbus RTU protocol) for my project work. The Modbus RTU protocol says that the query to slave must be framed i.e. succeeded and preceeded by 3 and half character elapse. I don't understand what it actually means, and how can it be achieved through c++ program. Please help me out.

Posted by Mark on 12 March, 2008 - 11:13 pm
Hello,

Assuming you are running on a MS Windows box it is not really possible, without creating a low level driver, but no worry, you do not need to handle the framing.

This is a master slave connection. For transmitting, send your query and wait for the response.

For receiving you can determine the response length by the query you transmitted. Continue to receive characters until you reach the predetermined count and then handle the message.

HTH,

Mark
http://www.hmisys.com

Posted by prashob on 15 March, 2008 - 2:22 am
Hello Mark,

Thanks for replying. I have developed a c++ program for carrying out data acquisition using Modbus protocol. I am trying to send and receive data from COM PORT 1 using outportb and inportb respectively in combination with userport.exe (which enables port access). This is meant to work on MS windows XP. I have the complete data which is to be sent along with the 2 byte crc. Do you think it will work out?

Reply to me at
prashob.n @ rediffmail. com

Posted by Mark on 15 March, 2008 - 4:37 pm
Hi,
Many programs exist, including ours, which communicate via a serial connection to devices using MODBUS RTU protocol.

So, I know it is possible.

If the question is will your program work, I do not know.

Good luck,
Mark
www.hmisys.com

Posted by prashob on 1 April, 2008 - 11:17 pm
Hi Mark,

Finally my program is running beautifully. Thanks for your comments.

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2008 Reed Business Information. Subject to its Terms of Use.

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-2008 Control Technology Corporation. All rights reserved.

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

Advertisement
Our Advertisers
Help keep our servers running...
Patronize our advertisers!