Professional Documents
Culture Documents
Ejemplo Funciones y Tramas de Datos. Modbus
Ejemplo Funciones y Tramas de Datos. Modbus
Ejemplo Funciones y Tramas de Datos. Modbus
de cada una
This command is requesting the ON/OFF status of discrete inputs # 10197 to 10218
from the slave device with address 17.
11 02 00C4 0016 BAA9
11: The Slave Address (11 hex = address17 )
02: The Function Code 2 (read Input Status)
00C4: The Data Address of the first input to read.
( 00C4 hex = 196 , + 10001 offset = input #10197 )
0016: The total number of coils requested. (16 hex = 22, inputs 197 to 218 )
BAA9: The CRC (cyclic redundancy check) for error checking.
Response
11 02 03 ACDB35 2018
11: The Slave Address (11 hex = address17 )
02: The Function Code 2 (read Input Status)
03: The number of data bytes to follow (22 Inputs / 8 bits per byte = 3 bytes)
AC: Discrete Inputs 10204 -10197 (1010 1100)
DB: Discrete Inputs 10212 - 10205 (1101 1011)
35: 2 space holders & Discrete Inputs 10218 - 10213 (0011 0101)
2018: The CRC (cyclic redundancy check).
The more significant bits contain the higher Discrete inputs. This shows that input 10197 is off (0)
and 10204 is on (1). Due to the number of inputs requested, the last data field 35 contains the
status of only 6 inputs. The two most significant bits in this data field are filled in with zeroes.
The more significant bits contain the higher coil variables. This shows that coil 20 is on (1) and 21
is off (0). Due to the number of coils requested, the last data field01 contains the status of only 2
coils. The unused bits in the last data byte are filled in with zeroes.
Response
11 0F 0013 000A 2699
11: The Slave Address (11 hex = address17 )
0F: The Function Code (Force Multiple Coils, 0F hex = 15 )
0013: The Data Address of the first coil.
( 0013 hex = 19 , + 1 offset = coil #20 )
000A: The number of coils to written ( 0A hex = 10 )
2699: The CRC (cyclic redundancy check) for error checking.