TCW241_R4.17
–
October 2022
Page 49
8.3.
MODBUS TCP/IP
Modbus TCP/IPprotocol is a serial communications protocol originally published by Modicon in
1979. It is used to establish master-slave/client-server communication between intelligent devices.
Modbus TCP/IP is often used to connect a supervisory computer with a remote terminal unit (RTU)
in supervisory control and data acquisition (SCADA) systems.
8.3.1.
Codes and answers
8.3.1.1.
Read Coil Status (FC=01)
Request
This command is requesting the ON/OFF status of discrete coils on address 100.
01 0064 0001
01: The Function Code 1 (read Coil Status)
0064: The Data Address of the coil to read ( 0064 hex = 100)
0001: The total number of coils requested. (01 hex = 1)
Response
01 01 01
01: The Function Code 1 (read Coil Status)
01: The number of data bytes to follow
01: 7 space holders & Coils 1 (0000 0001)
Due to the number of coils requested, the last data field
01
contains the status of
only 1 coil. The 7 most significant bits in this data field are filled in with zeroes. The
activated relay is 1.
8.3.1.2.
Force Single Coil (FC=05)
Request
This command is writing the contents of discrete on address 100 to ON.
05 0064 FF00
05: The Function Code 5 (Force Single Coil)
0064: The Data Address of the coil. ( 0064 hex = 100)
FF00: The status to write ( FF00 = ON, 0000 = OFF )
Response
The normal response is an echo of the query, returned after the coil has been written.
05 0064 FF00
05: The Function Code 5 (Force Single Coil)
0064: The Data Address of the coil. (0064 hex = 100)
FF00: The status written ( FF00 = ON, 0000 = OFF )
8.3.1.3.
Read Input Status (FC=02)
Request
This command is requesting the ON/OFF status of discrete input 1
02 0064 0001
02: The Function Code 2 (read Input Status)
0064: The Data Address of the input to read ( 0064 hex = 100 )
0001: The total number of coils requested.
Response
02 01 01
02: The Function Code 2 (read Input Status)
01: The number of data bytes to follow
Summary of Contents for TCW241
Page 1: ...smtp...
Page 16: ...TCW241_R4 17 October 2022 Page 16...
Page 55: ...TCW241_R4 17 October 2022 Page 55 Appendix A Fig 1 Fig 2...