Member Login
member
passwd
remember me on
this computer.

- join now -
- forgot username or password? -

Search

Jump to a Date

Sponsored Communities
Cool stuff
Select a topic of interest:
...and press:
Neat Stuff
Control.com Stuff

Visit our shop for nerds in control lifestyle products.

Fortune
"There was a boy called Eustace Clarence Scrubb, and he almost deserved
it."
-- C. S. Lewis, The Chronicles of Narnia
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/
To get a personalized feed, become a member at no cost.
Select a Page Style
Select one of the following styles:
- BluFu
- Classic
(cookies required)
advertisement
from the Automation List department...
To implement Modbus Poll
Communications systems and equipment. topic
Posted by sonainv on 10 August, 2008 - 3:52 pm
Hi all

I am trying to implement a Modbus poll command to query the registers of the Energy meter which communicates using RS485 using Modbus RTU protoco.

I am able to successfully generate the command to query the function holding registers of an energy meter.
The command consists of (Slave id,function,address,Databytes and CRC checksum).

I am sending the data to the energy meter through a RS232-RS485 interface.

I am sending the data 8bytes in one message without any delay between the bytes.

But I am not getting any response from the device.

My serial port settings and the Energy meter settings are matching.

Kindly give me your inputs to achieve this.

The whole code is written in c and using Evc++ serial port handler functions for sending the data to the meter.


Posted by autcon20 on 10 August, 2008 - 4:48 pm
Try to get a ModBus Slave simulator, and test your code. Also you could get a ModBus Master simulator and test if your energy meter ModBus functions.

Feel free to contact me at autcon20ATyahooDOTcomDOTar


Posted by sonachalam on 12 August, 2008 - 9:56 pm
Hi all,

Thanks for your replies and suggestions.

I have tested the Power meter using the Modbus poll simulator downloaded from modbustools.com

Using the Modbus poll I'm able to communicate with my meter. But I am unable to do the same with my code.

I'm sending the following command to the meter:

1. To poll the slave id 12 and function number 17 (diagnostic)

I am sending the command like last two bytes are CRC checksum.

0C11C4BC

2. To query the data in the specific register,
my address starts from 30001 and slave id is 12 and function number is 04.

0C04753100017B14

I am sending the data using the serial port communication.


Posted by Mark on 14 August, 2008 - 12:55 am
Hello,

Good. The meter works. Get the slave simulator I mentioned and try your code against it.

It will display the bytes the simulator receives and parse the message. If the CRC is bad it will tell you.

Good luck,

Mark
http://www.peakhmi.com


Posted by Mark on 10 August, 2008 - 4:48 pm
Hello,

Download the serial slave simulator from http://www.peakhmi.com and verify your code.

If it works the problem is in the meter. If it does not work the problem is in your code or the hardware.

Remove the 232<->485 device and go 232<->232. If it works the hardware is the problem.

If it does not work then your code is the problem or your 232 wiring.

Good luck,

Mark
http://www.peakhmi.com


Posted by Colman on 10 August, 2008 - 5:31 pm
Check your slave address.Also check the energy meter with the RS232-RS232 communication then the modbus cable. Use the Mb simulator to test the program.

thanks

Colman

From Control Engineering magazine...
Related articles from Control Engineering magazine
Above articles copyright 2009 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-2009 Control Technology Corporation. All rights reserved.

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

Internet Explorer 6.0 Fix

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