C1300
Advanced Circular Chart Recorder
5 Modbus Functions
IM/C1300–MOD
Rev. C
9
5 Modbus Functions
This section shows typical examples of Modbus function codes 01, 03, 05, 06, 08 and 16.
5.1 Read Coil Status – Function Code 01
5.1.1 Read Coil Status Query
This function allows the user to obtain the ON/OFF status of logic coils used to control discrete outputs from the addressed slave
only. Broadcast mode is not supported with this function code. In addition to the slave address and function fields, the message
requires that the information field contain the initial coil offset address to be read (starting address) and the number of locations to be
interrogated must obtain status data.
Example
– a read coil status request to read 16 coils from slave (01) starting at coil 31 (alarm A status channel 1) is shown below.
5.1.2 Read Coil Status Response
The data is packed one bit for each coil (1 = ON, 0 = OFF). The response includes the slave address, function code, quantity of data
characters, the data characters and error checking. The low order bit of the first character contains the first addressed coil and the
remainder follow. For coil quantities that are not even multiples of eight, the last characters are filled in with zeros at high order end.
Example
– the response to the read coil status query shows the following:
Alarm A status channel 1 ON
Alarm B status channel 1 OFF
Alarm C status channel 1 ON
Alarm D status channel 1 OFF
Alarm A,B,C,D status channel 2 all OFF
Alarm A,B,C,D status channel 3 all OFF
Alarm A,B,C,D status channel 4 all OFF
5.2 Read Holding Register – Function Code 03
5.2.1 Read Holding Register Query
The Read holding registers allow the user to obtain the binary contents of holding registers in the addressed slave.
Broadcast mode is not allowed.
Example
– a read holding register request to read 6 holding registers from slave (01) starting at holding address 121 (alarm trip A1) is
shown below.
Note.
The coil offset address is the coil number minus one, e.g. to start at coil 31 the data start value must be set to 30 (1EH).
Address
Function
Coil Start Offset
Number of Coils
Error Check Field
(CRC-16)
High
Low
High
Low
01
01
00
1E
00
10
5D
C0
Address
Function
Byte Count
Data Coil Status
31 to 38
Data Coil Status
39 to 46
Error Check Field
(CRC-16)
01
01
02
05
00
BA
AC
Note.
The data start register must contain the offset address of the first register to be accessed, e.g. to start at register 121 the
data start register must contain 120 (78H).
Address
Function
Register Start Offset
Data Number of Registers
Error Check Field
(CRC-16)
High
Low
High
Low
01
03
00
78
00
06
45
D1