Reference
This article delves into the Modbus-RTU communication protocol, explaining the data frame format, register addresses, and communication parameters essential for effective sensor data management.
Communication Protocol Description
1. Basic communication parameters
| Interface | Encoding | Data bits | Parity bits | Stop bits | Error checking | Baud rate |
|---|---|---|---|---|---|---|
| RS485 | 8-bit binary | 8 | None | 1 | CRC | 2400bit/s, 4800bit/s, 9600 bit/s configurable, default 4800bit/s |
2. Data frame format definition
Using Modbus-RTU communication protocol, the format is as follows:
Initial structure ≥4 bytes of time
Address code = 1 byte
Function code = 1 byte
Data area = N bytes
Error check = 16-bit CRC code
End structure ≥4 bytes of time
Address code: The address of the sensor, which is unique in the communication network (factory default 0x01).
Function code: The function indication of the command sent by the host. This sensor reads the register function code 0x03 and writes the register function code 0x06
Data area: The data area is the specific communication data. Note that the high byte of 16-bit data is in front!
CRC code: A two-byte check code.
Host inquiry frame structure:
| Address code | Function code | Register start address | Register length | Check code low bit | Check code high bit |
|---|---|---|---|---|---|
| 1byte | 1byte | 2byte | 2byte | 1byte | 1byte |
Slave response frame structure:
| Address code | Function code | Number of valid bytes | Data area 1 | Data area 2 | Nth data area | Check code |
|---|---|---|---|---|---|---|
| 1byte | 1byte | 1byte | 2byte | 2byte | 2byte | 2byte |
Register address
| Register address | Content | Operation | Range and definition |
|---|---|---|---|
| 0000H | Photosynthetically active radiation value | Read-only | True value |
| 0052H | Deviation value | Read-write | Photosynthetically active radiation deviation value (16-bit signed) |
| 07D0H | Device address | Read-write | 1~254 (factory default 1) |
| 07D1H | Device baud rate | Read-write | 0 represents 2400, 1 represents 4800, 2 represents 9600 |
3. Communication protocol example and explanation
3.1 Read the current photosynthetically active radiation value
Inquiry frame: Read value function code 0x03
| Address code | Function code | Register start address | Register length | Check code low bit | Check code high bit |
|---|---|---|---|---|---|
| 0x01 | 0x03 | 0x00 0x00 | 0x00 0x01 | 0x84 | 0x0A |
Response frame:
| Address code | Function code | Return valid bytes | Solar radiation value | Check code low bit | Check code high bit |
|---|---|---|---|---|---|
| 0x01 | 0x03 | 0x02 | 0x00 0x64 | 0x9B | 0xAF |
Photosynthetically active radiation value:
0064 (hexadecimal) = 100=> Photosynthetically active radiation value = 100μmol/㎡·s
3.2 Write deviation value
Inquiry frame: Write value function code 0x06
| Address code | Function code | Register address | Modify value | Check code low position | Check code high position |
|---|---|---|---|---|---|
| 0x01 | 0x06 | 0x00 0x52 | 0x00 0x0A | 0xA8 | 0x1C |
Response frame:
| Address code | Function code | Register address | Modify value | Check code low position | Check code high position |
|---|---|---|---|---|---|
| 0x01 | 0x06 | 0x00 0x52 | 0x00 0x0A | 0xA8 | 0x1C |
Write the current photosynthetically active radiation deviation value
000A (hexadecimal) =10=> photosynthetically active radiation deviation value = 10μmol/㎡·s, deviation value is 10μmol/㎡·s
3.3 modify the current address
Inquiry frame: (modify the current address to 0x02)
| Address code | Function code | Register address | Modify value | Check code low position | Check code high position |
|---|---|---|---|---|---|
| 0x01 | 0x06 | 0x07 0xD0 | 0x00 0x02 | 0x08 | 0x86 |
Response frame:
| Address code | Function code | Register address | Modify value | Check code low position | Check code high position |
|---|---|---|---|---|---|
| 0x01 | 0x06 | 0x07 0xD0 | 0x00 0x02 | 0x08 | 0x86 |
3.4 Modify the current baud rate
Inquiry frame: (Modify the current baud rate to 9600)
| Address code | Function code | Register address | Modify value | Check code low bit | Check code high bit |
|---|---|---|---|---|---|
| 0x01 | 0x06 | 0x07 0xD1 | 0x00 0x02 | 0x59 | 0x46 |
Response frame:
| Address code | Function code | Register address | Modify value | Check code low bit | Check code high |
|---|---|---|---|---|---|
| 0x01 | 0x06 | 0x07 0xD1 | 0x00 0x02 | 0x59 | 0x46 |
3.5 Query current address and baud rate
Inquiry frame:
| Address code | Function code | Register address | Data length | Check code low | Check code high |
|---|---|---|---|---|---|
| 0xFF | 0x03 | 0x07 0xD0 | 0x00 0x02 | 0xD1 | 0x58 |
Response frame:
| Address code | Function code | Return valid bytes | Address | Baud rate | Checksum low bit | Checksum high bit |
|---|---|---|---|---|---|---|
| 0x01 | 0x03 | 0x04 | 0x00 0x01 | 0x00 0x01 | 0x6A | 0x33 |
The real address of the device read is 01, and the baud rate is 0x01, that is, 4800.
Principle
The photosynthetically active radiation sensor uses the principle of photoelectric sensing and can measure the photosynthetically active radiation value in the spectral range of 400-700nm. The sensor uses high-precision photoelectric sensing elements, wide spectrum absorption, high absorption, and good stability; when there is light, it generates a voltage signal proportional to the intensity of the incident radiation, and its sensitivity is proportional to the cosine of the direct angle of the incident light.
Other Supplementary Information
Explanation of measurement units
umol/m²•s is the unit of photosynthetically active radiation. Photosynthetically active radiation refers to the radiation of effective light energy that plants can absorb and use during photosynthesis. Photosynthetically active radiation usually refers to light with a wavelength in the range of 400-700nm, which is the range of light required for plants to photosynthesize.
The umol in umol/m²•s stands for micromoles, a unit that describes the number of photons in the photosynthesis process. m² represents the area per square meter, and s represents the unit of time, i.e. seconds. Therefore, umol/m²•s represents the number of photons of photosynthetically active radiation per square meter per second.
The unit of photosynthetically active radiation, umol/m²•s, is often used to measure the intensity of photosynthesis and the growth status of plants. By measuring the number of photons of photosynthetically active radiation per square meter per second, the photosynthetic efficiency and photosynthetic rate of plant leaves can be evaluated, and a reference can be provided for plant growth, photosynthesis research, etc.
Was this article helpful?
