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
Lighten up, while you still can,
Don't even try to understand,
Just find a place to make your stand,
And take it easy.
-- The Eagles, "Take It Easy"
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 Automation List department...
Siemens Sentron PAC
Applications topic
advertisement
Posted by boni on 3 May, 2008 - 3:35 am
Dear all,

My factory purchase some Siemens Sentron PAC power meters. We would like use it to monitor several panels we have.

The operating manual mentioned that the device uses Modbus TCP as its communication protocol, and also mentioned some Modbus commands to deal with.

Now we are going to create a Visual Basic program to read the measurement from a PC. To do this, I have read some literature on Visual basic Winsock control and Modbus protocol. But now there are some questions in my mind.

I have nither experience nor knowledge on Modbus so would you mind to help answer some questions below?

On Modbus commands (0x03,0x04, 0x10), what does "x" mean?

On the Sentron PAC manual, they inserted a table of communication parameters. On this table there are "Offset" and "Number of Tabs" Columns, what should I do with data on each column?

I have read some web site talking about OPC servers. Is this software to manage a database like SQL server?

Am I on the right track using Winsock to create an "Ethernet base" connection from VB 6 program?

Thank you for all of your kindness to help.

Irwan_Grahadian @ Telkom. net

Posted by Michael Griffin on 4 May, 2008 - 7:27 pm
I can't answer your questions regarding the Siemens Sentron PAC itself, but I can answer some of your other questions.

Having numbers written as "0x03,0x04," or "0x10" is not normal Modbus convention. It is however common programming convention in most programming languages for expressing hexadecimal numbers. So, their equivalent in normal decimal would be 3, 4, and 16.

Modbus commands are called "functions". The functions are numbered 1, 2, 3, 4, etc. The function numbers you referred to above do the following. 3 is "read holding registers". 4 is "read input registers". 16 is "write multiple registers".

The Modbus protocol classifies device memory as discrete inputs, coils (both of these being bit addresses), input registers, and holding registers (both of these being 16 bit integers). The addresses themselves are simply numbered from 0 to 65,535 for each type of address (although the actual address range in your meter may be much smaller). Note that this is how the Modbus *protocol* numbers addresses. Some people do things at the application level such as offset the numbers by one, or add a numerical prefix to indicate which memory type they are referring to. Neither of these is part of the Modbus protocol standard itself though.

How your power meter uses these addresses was up to the power meter designer. You will have to read the manual to find out what addresses to read and/or write.

An "OPC server" is a type of communications protocol driver. OPC is an industry trade organisation that came up with a common interface to protocol drivers. OPC servers can be quite complex as it is a generalised interface with a lot of features (most of which you won't need).

You can buy OPC servers (drivers) for the Modbus/TCP protocol which you can interface to your VB program. However, since Modbus is actually an open protocol (unlike many others in industry), there are many alternative drivers as well which don't use an OPC type interface.

You probably only need to open an Ethernet socket connection if you are writing your own driver. If you are using an off the shelf driver (OPC or a Modbus/TCP library), then that driver should take care of opening its own socket.

Posted by al-van on 9 May, 2008 - 10:28 pm

Hi,

I have had several projects using similar devices that uses Modbus protocol and the minimum requirements were to use VB6. Rudolf R-DPA and Genius Power Meters were the devices used.

Just to get you started.

VB6 format for modbus protocol:
slave address, function code, data, crc

Example:


---------------------------
| 05 | 03 | 03 | 00 | crc |
---------------------------

where:
05 = slave address
03 = function code (holding registers)
03 = 0300 hex addr of the value for the meter
00 =
crc = modbus crc format

temp = chr("&H"+"05") + chr("&H"+"03") + chr("03") + chr("&H"+"00") + chr("&H"+ crc_highbyte) + chr("&H"+ crc_lowbyte)

then send the temp to the winsock if using Modbus TCP.

Note:
You could uses Modbus RTU using serial comm
by using a device server from Moxa.

You can get in touch with me if you need more detailed example for a Modbus implementation.
I could also give you some codes to produce the Modbus CRC in VB implementation.

Cheers!

alvan_basco @ yahoo. com. ph


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!