Chapter 5 Introduction To Modbus Rtu Commands; Read Coil Status - Ebyte E150-400T30S User Manual

400m frequency band 1w lora wireless acquisition control module
Table of Contents

Advertisement

Chengdu Ebyte Electronic Technology Co.,Ltd.

Chapter 5 Introduction to Modbus RTU Commands

Modbus RTU has a total of 8 function codes (hexadecimal), and their meanings are as follows:
function code
01

Read coil status

02
Read discrete input
03
read holding register
04
read input register
E150-400T30S modules can communicate with E22-400Txxx series modules wirelessly, but the following
conditions must be met:
Both modules need to work in "transparent mode";
The parameters of "air rate", "channel address", "module address" and "network number" of both modules
must be consistent;
The following commands related to remote wireless communication must meet the above conditions.
5.1 Read coil status
Using the read coil status (01) function code to read the output coil status, for example: read the status of
do1 ~ do4
01
Device MODBUS
Function code
address
CRC check code note: the CRC check code of the last two bytes of the sending instruction needs to be calculated
by the user.
Serial port sending: 01 01 00 00 04 3D C9
Remote wireless transmission: 01 01 00 00 00 04 3D C9
After the above command is sent to the device through the serial port or wireless, the device will return the
following values to the serial port or wireless:
01
Device MODBUS
Function code
address
The returned status data 0f indicates that the outputs do1 to do4 are at a high level.
Serial port receiving return value: 01 01 01 0f 11 8C
Copyright ©2012–2022,Chengdu Ebyte Electronic Technology Co.,Ltd.
illustratation
01
00 00
Register
head address
01
01
Number of
bytes of data
function code
05
write coil status
06
write a single register
0F
write multiple coils
10
write multiple registers
00 04
Number of output
coils read
0F
Returned
status
data
E150-400T30S user manual
illustration
3D C9
CRC check
code
11 8C
CRC check
code
10

Advertisement

Table of Contents
loading

Table of Contents