Chapter 6, Planning your application program, 3-2 modbus function code introduction – B&B Electronics ADAM-5000_TCP - Manual User Manual
Page 100: Adam-5000/tcp user’s manual

Planning Your Application Program
And the response should be:
Chapter 6
Figure 6-2: Response Comment Structure
6-3-2 Modbus Function Code Introduction
To full-fill the programming requirement, there is a series of function code
standard for user’s reference...
Code (Hex) Name
Usage
01
Read Coil Status
Read Discrete Output Bit
02
Read Input Status
Read Discrete Input Bit
03
Read Holding Registers
Read 16-bit register. Used to read integer or
04
Read Input Registers
floating point process data.
05
Force Single Coil
Write data to force coil ON/OFF
06
Preset Single Register
Write data in 16-bit integer format
08
Loopback Diagnosis
Diagnostic testing of the communication port
15
Force Multiple Coils
Write multiple data to force coil ON/OFF
16
Preset Multiple Registers
Write multiple data in 16-bit integer format
Table 6-1: Response Comment Structure
Function Code 01
The function code 01 is used to read the discrete output’s ON/OFF sta-
tus of ADAM-5000/TCP in a binary data format. Request message
format for function code 01:
Command Body
Station
Address
Function
Code
Start
Address
High Byte
Start
Address
Low Byte
Requested
Number of Coil
High Byte
Requested
Number of
Coil Low Byte
ADAM-5000/TCP User’s Manual
6-33