Solved

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

Posted on 2016-08-16
4
74 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
  • 3
4 Comments
 
LVL 20

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 20

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 20

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
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.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now