Solved

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

Posted on 2016-08-16
4
81 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

756 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