Modbus Register

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

Modbus Register

Coil and register

Introduction earlier Modbus The content mentions coils multiple times (coil) And registers (register) The concept, especially Modbus function code In the middle,The objects of operation are basically coils and registers.

in Modbus The reason why they are still referred to as coils and registers in the protocol, It's entirely due to historical reasonsIn PLC Application areas, One coil represents one PLC output point, Also known as output relay. Change the output state of the relay by controlling the conduction of the coil, Realize weak current control and strong current.

Modbus RegisterFigure

but in fact, In today's Modbus In the device, They all just correspond to a memory area. among which, Coil representative position operation (bit) , Representing a Boolean variable; Register represents word operation (word) , Representing an integer variable (Of course, it can also be done by combining multiple words, Representing floating-point numbers and other composite data structures). in Modbus in the agreement, word(word) The length is 16 Position, i.e 2 bytes.

Description of Register Types

in Modbus in the agreement, All data is stored in registers. Based on the type of data stored and their respective read-write characteristics, The register can be divided into four parts, These four parts can be continuous or discontinuous, Completely determined by the developer.

The following table shows the meanings of four types of registers and their relationship with PLC The analogy.

Register typemeaningPLCExample
Coil status
(Coil Status)
output port (readable and writable) DO (digital output) Electromagnetic valve output, LED display
Discrete input state
(Input Status)
Input port (read-only) DI (Digital input) DIP switch, Micro Switch
holding register
(Holding Register)
output parameters (readable and writable) AO (Analog output) PID operating parameters, Threshold upper and lower limits
input register
(Input Register)
input parameters (read-only) AI (Analog input) Sensor data input

Register Address Allocation

Modbus The allocation of register addresses is shown in the following table, Also referenced PLC Method for allocating register addresses.

Register typeregisterPLCaddressregisterModbusContract AddressAbbreviation
Coil status00001~099990000H~FFFFH0x
Discrete input state10001~199990000H~FFFFH1x
holding register40001~499990000H~FFFFH4x
input register30001~399990000H~FFFFH3x

In this table PLC The address can be understood as Modbus Variations of Protocol Address, On the touch screen and PLC Widely used in programming.

  • register PLC The address refers to the address stored in the controller, These controllers can be PLC, It can also be a touch screen, Or text display. PLC The address is generally described in decimal system, common 5 Position,The first digit represents the register type.
  • register Modbus Protocol address refers to the register addressing address used during communication, for example PLC address 40001 Corresponding addressing address 0x0000, 40002 Corresponding addressing address 0x0001. Register addressing addresses are generally described in hexadecimal format.

Careful you will find, PLC register address 40003 The corresponding protocol address is 0x0002, PLC register address 30003 The corresponding protocol address is also 0x0002, Although two identical ones are used for communication Modbus Contract Address, But because the function codes of different registers are not the same, Therefore, there is no access conflict.

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.