Modbus read-write analog register specific explanation

Source: Internet
Author: User

Read-Write Analog registers:

Send command (host to slave) format:

[Device Address] [Command Number[High Start register address8bit] [Low8bit] [high number of registers read8bit] [Low8bit] [CRCthe low checksum8bit] [CRCthe High calibration8bit] 

Example:[11][03][00][6B][00][03][CRC low ][CRC high ]

Meaning for example the following:

All: The address of the device, the address in The sample is one, the default address of the dissolved oxygen sensor side is 1,.

A: the command number of the reading analog is fixed to the agreement, which is stipulated in the Modbus protocol.

00 6b 8 bit ( Span style= "Font-family:times New Roman;" >00 , low 8 bit (6b ) : Represents the starting address of the analog that you want to read, such as the starting address in the sample is 107 this 006b represents a full address, Note that the address here is high 8 bit in front, low bit behind.

00 03 8 bit ( Span style= "Font-family:times New Roman;" >00 , low 8 bit (03 ) : Indicates how many analog volumes are read from the start address (each of the returned simulations is represented in two bytes). The example is 3 analog. Note that an analog in the returned information needs to return two bytes the same time the address here is also high 8 8 bit at the back .

[CRC low ][CRC high ]: CRC-16 Check at the end of the frame , it is particularly important to note that the calibration results are 8 Lower Bit in front, high 8 bits behind, this order differs from the start address and the address order of the read depth.

Device response:[Device Address] [Command Number[number of bytes returned][Data1] [Data2] ... [DataN] [CRCthe low checksum8bit] [CRCthe High calibration8bit] 

Example:[11][03][06][02][2B][00][00][00][64][CRC low ][CRC high ]

Meaning for example the following:

One: device address (slave address).

: Command number.

: number of bytes returned (no high two-byte checksum): The number of bytes representing the data, that is, the value of n in data 1,2...n . The sample returns 3 analog data with a total of 6 bytes due to a 2 - byte analog amount .

Data1...N: Among[Data1] [Data2]each is the first1a high number of analog8bit and low8bit,[Data3] [Data4]is the first2a high number of analog8bit and low8bits, and so on. The values returned in the sample are each555,0, -.

[CRC Low ][CRC high ]: CRC Check Ibid.

Write a single analog register:

Send command (host to slave) format:

[Device Address] [Command Number[High register address to be placed8bit] [Low8bit] [high data in the lower position8bit] [Low8bit] [CRCthe low checksum8bit] [CRCthe High calibration8bit] 

Example:[11][06][00][01][00][03][CRC low ][CRC high ]

Meaning for example the following:

One: The device address is the same as above.

: The command number to write analog is fixed to .

XX: The register address to be written is 8 bits High and 8 bits lower.

XX: The data to be written is 8 bits High, 8 bits lower. For example, the value of the 1 Register is set to 3.

Note that this command can only write to a state of an analog amount.

[ Low 8 -bit CRC check ] [ high 8 -bit CRC check ] Ibid.

Device response: Assume that the command sent by the computer is successfully returned, otherwise it will not respond.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.