8 (48)
3
Modbus Application Interface
The host application interface of the product consists of a Modbus Serial interface, which
implements a reduced set of registers and commands. The Anybus CompactCom acts as a
Modbus RTU slave.
3.1
How To Set Up and Initialize the Modbus Communication
To set up and initialize the communication between the host application and the network, follow
the steps below. Steps 2 - 6 includes examples of what the Modbus messages can look like.
1.
Set Modbus address, baud rate, stop bits, and parity according to
See
for information on how to connect the corresponding pins.
2.
Write initial values to the Write Process Data area (registers 0x0000-). (Optional)
Example – Using the Modbus function
Write Multiple Holding Registers
to set
initial values for 10 Write Process Data registers (20 bytes) to CompactCom with address 5.
Address
Function Code
Data
CRC
Starting
Address
Quantity of
Registers
Byte Count
Register
Values
0x05
16
0x0000
10
20
20 bytes of
data
CRC-16-ANSI
3.
Write switch settings to register 0x5200-0x5201, “Application switch 1” and “Application
switch 2”. Optional for networks that do not require these settings.
Example – Using the Modbus function
Write Single Holding Register
to set the
Node Address for a network using a node address for identification. NOTE: Node address 7
will be used on the Industrial Network (e.g. PROFIBUS).
Address
Function Code
Data
CRC
Register Address
Register Value
0x05
6
0x5200
7
CRC-16-ANSI
4.
Set Offline Action for Read Process Data in register 0x5101 (Clear or No action). (Oprtional)
Example – Using the Modbus function
Write Single Holding Register
to configure
Clear
as the Offline Action for Read Process Data (all data will be 0 if the network is
offline).
Address
Function Code
Data
CRC
Register Address
Register Value
0x05
6
0x5101
0
CRC-16-ANSI
5.
Set the size of the Write Process Data area to register 0x5102. Data type (byte or word) is
configured with register 0x5100.
Example – Using the Modbus function
Write Single Holding Register
to configure
Write Process Data size 20 bytes. Assuming default value of register 0x5100, i.e. data type is
UINT8.
Address
Function Code
Data
CRC
Register Address
Register Value
0x05
6
0x5102
20
CRC-16-ANSI
Anybus
®
CompactCom
™
B40 Modbus Serial User Manual
SCM-1202-130 1.1 en-US