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
What the large print giveth, the small print taketh away.
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...
Modbus addressing models
Communications systems and equipment. topic
Posted by Fred Wedemeier on 26 July, 2008 - 1:53 am
The Modbus application protocol spec defines a 16-bit address plus a number of function codes to direct that address to one of several data types.

It's also apparent that the upper digit of a decimal address is used to indicate data type. Quoting from one user manual, "Notice that the Modbus protocol uses a 5-digit representation for the slave data address which infers the point-type. For example, INPUT STATUS values are always represented in the range 10001-19999: HOLDING REGISTERS are displayed as 40000-49999...." Examining user guides for several instruments shows that all do indeed use addresses in the 4xxxx range for holding registers.

Where is the usage of the upper digit specified?

I cannot locate it in any of the Modbus specs, and the Application spec even states that mapping is "totally vendor device specific."

If usage isn't specified but is done by convention, could someone please clue me in to the convention?

Thx!

fcweed at mail. com


Posted by Michael Griffin on 27 July, 2008 - 11:54 am
The Modbus *protocol* doesn't use any numerical prefixes to indicate data type. Modbus just numbers addresses from 0 to 65535 in 16 bit natural binary for each data type. You select the appropriate data type according to which read or write function code you use.

Some *applications* use a numerical prefix in their user interface. This seems to be something that has arisen through convention (Modicon used it in their programming software and PLC manuals). It has nothing to do with what goes out over the wire in the actual protocol though. They could just as easily have used "I", "Q", and "V" in their manuals for all the difference it would have made.

The actual protocol documents describe the data types as Discrete Inputs, Coils, Input Registers. and Holding Registers. I haven't seen anything about numerical type prefixes anywhere in the Modbus standards documents that I have read.

So far as I know, the convention is 0 = Coils, 1 = Discrete Inputs, 3 = Input Registers, and 4 = Holding Registers. Note though that these numbers are not actually part of Modbus.


Posted by Mark on 27 July, 2008 - 11:55 am
Hello,

>Where is the usage of the upper digit specified?

I do not want to be pedantic.

On the first line/paragraph of the MODBUS specification, PI-MBUS-300, for each function code, 1,2,3,4,5, etc., is defined the area of memory and type of memory the function accesses.

MODBUS APPLICATION PROTOCOL SPECIFICATION V1.1a might help.

The 0,1,3,4 etc. is how a Modicon controller referred to an area and type of memory when the protocol/spec was created.

The size of the different device memory areas is device specific. Look in the device documentation for memory size and type mapping.

So, the spec was written referring to Modicon controllers. The function codes are what defines the data type and how to access it. It really could all point to the same memory area.

The original protocol documents do not refer to the first digit in the description of the functions. It refers to the name of the area. (Holding Register, Coils, etc)

The first digit could be any digit.

HTH,

Mark
http://www.peakhmi.com/


Posted by JC on 29 July, 2008 - 1:03 am
You can think of 10051, 30034, 40021, etc. as register 'Names'. You can subtract an offset from the 'Name' to get the register number or address.

For example, the 40000 block uses an offset of 40001. 40021 - 40001 = register 20 (14 in hex). The actual code uses hex 14 to specify the 20th register and a function code to specify which block of data (the 40000 block). Some systems use a 6 digit naming convention, 400001, but the code is the same.

This is explained further on the web page http://www.simplymodbus.ca/FAQ.htm

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!