Solved

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

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Moving your enterprise fax infrastructure from in-house fax machines and servers to the cloud makes sense — from both an efficiency and productivity standpoint. But does migrating to a cloud fax solution mean you will no longer be able to send or re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

773 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