Modbusrtu message format details

Modbus is a serial communication protocol that Modicon published in 1979 for the use of programmable logic controllers (PLCs). In fact, it has become the standard for communication protocols in the industrial sector and is now a fairly common connection between industrial electronic devices.

The Modbus protocol currently has versions for serial, Ethernet, and other networks that support Internet Protocol.

Most Modbus device communication takes place via the serial EIA-485 physical layer. For serial connections, there are two variants that differ slightly in numerical data representation and protocol details. Modbus RTU is a compact, binary representation of data. Modbus ASCII is a human-readable, lengthy representation. Both variants use the serial communication (serial communicaTIon) approach. Subsequent commands/data in the RTU format have a checksum of the cyclic redundancy check, while the ASCII format uses a checksum of the vertical redundancy check. Nodes configured as RTU variants will not communicate with nodes set to ASCII variants, and vice versa.

A message analysis of modbusrtu

First declare our purpose, we want to communicate with two devices, using the MODBUS protocol. The above briefly introduces: "message" "CRC check" "function number".

Take some memory (RAM) in the MCU for two devices communication, for example:

Modbusrtu message format details

Comment after the array, description

OX[20] represents the output coil, accessed with function codes 0x01, 0x05, 0x0F, and the starting address is 0 (this follow-up description)

IX[20] represents the input coil, accessed with function code 0x02, and the starting address is 1 (this follow-up description)

The other two are the same.

Note: The so-called "coil" "register" is the "bit variable" "16-bit variable", do not be confused. The reason why it is called "coil" I think should be for the application equipment, MODBUS protocol is specifically developed for 485 bus equipment (such as PLC).

1, the host writes data to the slave

If the MCU receives a message, it parses the message and performs the corresponding processing, such as the above message:

01 06 00 01 00 17 98 04

Slave address function number data address data CRC check

If the local address is 1, then the MCU receives the data according to the data and calculates whether the CRC check data is correct. If the data is correct, the result is:

HoldDataReg[1] = 0x0017;

The MODBUS master completes a write operation on the slave data and implements communication.

2, the host reads the data from the machine

When the host reads the HoldDataReg[1] operation, the message is:

01 03 00 01 00 01 D5 CA

Slave address function number data address read data number CRC check

Then, the MCU receives the string of data and calculates whether the CRC check data is correct according to the data. If the data is judged to be correct, the result is: returning the information to the host, and the returned information is also formatted:

Return content:

01 03 02 0017 F8 4A

Slave address function number data byte number two bytes data CRC check

The MODBUS master completes a read operation on the slave data and implements communication.

MODBUS message model

The above has learned how a frame of MODBUS messages are communicated. In fact, the format of each message is basically the same.

Modbusrtu message format details

The two abbreviations here are not known before, but now I have to understand what it means, "ADU" "PDU"

ADU: Application Data Unit

PDU: Protocol Data Unit

Modbusrtu message format

All exchanged RTU type messages (frames) have the same structure regardless of the uplink/downlink:

Modbusrtu message format details

Each frame of message contains 4 types of information:

Slave number

The slave station number is 1 byte and the value ranges from 0 to FFH. Exceptionally, if this value is 0, it is the broadcast message identifier of the primary station. Therefore, the physical slave number can only be between 01H and FFH (that is, between 1 and 255).

function code

The function code is 1 byte. It is used to select a command (read, write or answer check is correct, etc.). The valid function code range is from 1 to 255. The function codes supported in this manual will be in Chapter 2. To be detailed.

Data area

The data area is n bytes and contains a string of hexadecimal data associated with the function code.

Dell Adapter

Laptop power adapter charger for Dell:

Laptop Model Adapter Output
Latitude E5400 E5410 E5500 E5510 19.5v 4.62a, 7450
Studio XPS 16 (1645)1640 1645 1647 19.5v 4.62a, 7450
Studio XPS M1645 M1647 19.5v 4.62a, 7450
XPS 14 15 17 L501x L502x L702x L702x 19.5v 4.62a, 7450
Inspiron 1464 1564 1764 19.5v 4.62a, 7450
Inspiron 1525 1440 1526 19.5v 3.34a, 7450
Precision M4600 M6600 19.5v 6.7a, 7450
Inspiron N5050 N4010 N5110 19.5v 3.34a, 7450
Inspiron 14Z-N411Z 13Z N311Z 19.5v 4.62a, 7450
Inspiron 1545 19.5v 3.34a, 7450
Latitude E5420 E5530 E5430 E6420 19.5v 4.62a, 7450
Inspiron 1440 1525 1526 1545 1750 19.5v 3.34a, Octagon tip
Inspiron 1300 B120 B130 19v 3.16a/3.42, 5525
Inspiron 1525 1526 1545 19.5v 3.34a, 7450
Studio 1440 1440n 1440z 14z 14zn 19.5v 3.34a, 7450
Latitude E4300 E4310 19.5v 4.62a, 7450
Inspiron 13Z 13ZD 13ZR M301 M301z M301ZD M301ZR N301 19.5v 3.34a, 7450
Inspiron N301Z N301ZD N301ZR 19.5v 3.34a, 7450
Studio 1535 1536 1555 1557 1558 19.5v 4.62a, 7450
Latitude E5420 E5520 E6430 E6530 E6420 E6520 19.5v 4.62a, 7450
Inspiron Mini 10 10v 1010 1010n 1010v 1011 1011n 1011v 19v 1.58a, 5517
Inspiron 14V 14VR M4010 N4020 N4030 19.5v 4.62a, 7450
Inspiron N4110 N5110 N7110 M5010 19.5v 3.34a, 7450
630M 640M E1405 19.5v 4.62a, 7450
Inspiron 15-3521 17-3721 19.5v 3.34a, 7450
Latitude 120L 19.5v 3.34a, 7450
Vostro 1710 1710n 1720 1720n 19.5v 4.62a, 7450
Vostro 1500 1700 Inspiron 1520 1521 1720 19.5v 4.62a, 7450
Vostro 1400 1420 PP26L 19.5v 3.34a, 7450
Latitude D410 19.5v 3.34a, 7450
Inspiron 1120, 1121, M101 19.5v 3.34a, 7450
Inspiron Mini 1012 1018 19v 1.58a, 5517


Our service:

Stable output and high charging efficiency.

Elegant outlook design as original one, touch smoothly and comfortable.

Original charger is good, but as a replacement, our product has more reasonable price when your original charger is broken.

And, the market of the replacement adapters becomes bigger and bigger. People would rather buy a copy one then the original because of the price.

But at the same time, people worry about that they will buy something defective. So the problem comes, how to buy a good quality one with a good price?

As a professional power adapter manufacturer, we have excellent R&D team, skilled staffs and responsible after-sale service. All your benefits can be under protected after you buy products for our company.

Our certificates :ISO9001:2008 & ISO14001:2004 , CCC , CE , FCC , ROHS.

All our products has 1 year warranty. In other words, if you get the dad products which are not damaged physically from us in one year, we will replace you the new one or the whole bulk order.

Mini Charger For Dell,Big Connector Adapter,45W Power Adapter,Dell Computer Adapter

Shenzhen Waweis Technology Co., Ltd. , https://www.laptopsasdapter.com

Posted on