Solved

Modbus - whats the maximum I can store in one register?

Posted on 2016-08-16
4
84 Views
Last Modified: 2016-08-17
Hi

I'm trying to find out what the max value I can store in one register on Modbus
I.e. register number 40001

I'm not sure if i can store 4, 8 or 16 digits
i.e. 9999 or 99999999  etc

Does anyone know?
0
Comment
Question by:websss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 21

Expert Comment

by:viki2000
ID: 41758870
But Modbus is a communication protocol. The register belongs to a specific hardware PLC.
What PLC do you use?

For example here at the bottom of page is mentioned under Modbus function codes - Data Access 16bit, but then in Implementing is mentioned also floating and integer  32bit:
https://en.wikipedia.org/wiki/Modbus
0
 

Author Comment

by:websss
ID: 41758895
Thanks
I know about modbus and hardware

I'm create my own modbus simulated hardware...  I won't bother going in why,  but I need it

So I can store a 32bit value in each?
0
 
LVL 21

Accepted Solution

by:
viki2000 earned 500 total points
ID: 41758946
The data is max. 32bit, but the max. value of a register seems 16bit in a hardware PLC according with various hardware PLC manufacturers.
How is this 32bit handled over the Modbus I do not know exactly, but the specs of Modbus from Wikipedia says under:
1) "Modbus RTU frame format (primarily used on 8-bit asynchronous lines like " and then "Data       n × 8       Data + length will be filled depending on the message type", where nx8 is the length, number of bytes.
2)  "Modbus ASCII frame format (primarily used on 7- or 8-bit asynchronous serial lines)"  and then "Data       n × 2       Data + length will be filled depending on the message type", where nx2 is the length, number of bytes.
This is related only with how the data is sent on Modbus protocol.

The value of the register depends by hardware, particularly the processor used. In your case, being a simulation software, you may decide what processor architecture you want to simulate, but for compatibility purpose with real hardware it would be good to go with max. available on the market, which as common seems 16bit for a register.
32bit is related with Data.

If we speak about Input/Output, Holding or Internal Register then is 16bit only.
What type of register is your "register number 40001"?
What processor do you want to emulate?
What kind of Modbus protocol version do you want to implement?

Modbus_1
Modbus_2
Modbus_3
Modbus_4
1
 
LVL 21

Expert Comment

by:viki2000
ID: 41760067
Thank you for the points and in the same time I hope my answer helps you and does not confuse you.
In microcontrollers for example, you may have data as float or 16bit integer, but the hardware registers, the memory cell, can be only 8bit. Then for one float or long or unsigned int we need more than 8 bits and it uses more memory locations.
The idea is that for Modbus you have 16bit registers, but also 32bit data, integer or float.
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question