9 (48)
6.
Set the size of the Read Process Data area to register 0x5103. Data type (byte or word) is
configured with register 0x5100.
Example – Using the Modbus function
Write Single Holding Register
to configure
Read Process Data size 18 bytes. Assuming default value of register 0x5100, i.e. data type is
UINT8.
Address
Function Code
Data
CRC
Register Address
Register Value
0x05
6
0x5103
18
CRC-16-ANSI
7.
The CompactCom is now ready to start communicating with the network master with the
configured settings. Start cyclical read/write of process data to register 0x0000- and 0x1000-.
Also consider to cyclically monitor the values of register 0x0FFD (Anybus Switch Status),
0x0FFE (LED status), and 0x0FFF (Anybus Status).
If a reset request is indicated in the Anybus Status register, the host application must reset
the CompactCom, and start the initialization sequence from step 1. See
Example – The Modbus function
Read/Write Multiple Registers
allows you to
both read and write registers with one command. In this example the status registers and
the read process data registers are read, at the same time as the write process data
registers are written.
Command:
Address
Function Code
Data
CRC
Read
Starting
Address
Quantity
to Read
Write
Starting
Address
Quantity
to Write
Write
Byte
Count
Write
Reg
Values
0x05
23
0x0FFD
12
0x0000
10
20
20 bytes
of data
CRC-16-ANSI
Response:
Address
Function Code
Data
CRC
Read Byte Count
Read Reg Values
0x05
23
24
24 bytes of data
CRC-16-ANSI
The Anybus CompactCom will stay in state SETUP until values have been written to 0x5102 and
0x5103 (items no. 5 and 6 in the list above). The Anybus CompactCom will then change states to
WAIT_PROCESS, and the registers 0x5100-0x5103 will be read-only.
See also ..
•
The Anybus State Machine, p. 42
Anybus
®
CompactCom
™
B40 Modbus Serial User Manual
SCM-1202-130 1.1 en-US