12 Modbus/TCP for Digital-Input/Output
12.2 Examples
12.2.1 Read two input signals
Function Read Coils is native to get the status of input signals. Here we read the status of Input
2 and 3, to see if the two pins of each are connected to each other or not.
Request:
Function Code
01
one byte
Start Address
0001
a 16 bit value (two bytes), 01 refers to Input 2
Quantity
0002
a 16 bit value (two bytes), two values shall be read.
Response:
Function Code
01
one byte, the same as in the request
Byte Count
0001
one byte. The requested data are two bits only, they fit in one
byte
Data Byte
02
one byte as an example. This least significant bit (LSB) states
the Input 2 is open (zero), and Input 3 is closed (One)
In the same way it is possible to read the status of the output signals. Normally your application
would know this status, since it is likely it defined this before the request.
12.2.2 Write one output signal
This example will set the status of Output 8 to 1 (One), to make a connection between the pins
labelled 8 (central) and S.
Request:
Function Code
05
one byte
Output Address
0015
a 16 bit value (two bytes), 07 refers to Output 8
Value
FF00
a 16 bit value (two bytes), a special value as opposite to 0000
Response:
Function Code
05
one byte
Output Address
0015
a 16 bit value (two bytes), the same as in the request.
Value
FF00
a 16 bit value (two bytes)
In this case the response looks the same as the request.
September 2016
NetCom Plus User Manual
124
Summary of Contents for NetCom Plus 111
Page 133: ......