Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 102
  • Last Modified:

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

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
websss
Asked:
websss
  • 3
1 Solution
 
viki2000Commented:
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
 
websssAuthor Commented:
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
 
viki2000Commented:
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
 
viki2000Commented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now