
I185 GB 06 15
LRX D01
100
There are 5 parameters in MODBUS function as shown below.
Symbol
Description
MODBUS mode (1~5)
Communication address: slave ID, range: 0~127
Communication content: address and data length:
1
address is constant, range: 0000~ffff; length must be 1 word
2
DR code, get address and length from this DR and the next
DR code, store sending/receiving data from this DR
MODBUS code (MU01~MU0F)
Examples:
Mode
Display
1
Address is constant: 0003,
Receive:
Read register
Length
≡
1,
01 03 02 data1 data2 CRC16,
Send: 01 03 00 03 00 01 CRC16;
data storage:
DRE0= (data1<<8) | data2,
Address is DR03=0001,
Receive: 01 03 04 data1 data2
Length is DR04=0002,
data3 data4 CRC16,
Send: 01 03 00 01 00 02 CRC16;
data storage:
DRE0= (data1<<8) | data2,
DRE1= (data3<<8) | data4
2
Address is constant: 0003,
Receive:
Write single
Length
≡
1,
01 06 00 03 04 D2 CRC16
register
data storage: DRE0=1234(hex: 04D2)
Send:
01 06 00 03 04 D2 CRC16
Address: DR03=0001,
Receive:
data storage: DRE0=1234(hex: 04D2)
01 06 00 01 04 D2 CRC16
Send: 01 06 00 01 04 D2 CRC16
3
Address: 0003
Length
≡
1,
Receive:
Write register
data storage: DRE0=1234(hex: 04D2)
01 10 00 03 00 01 CRC16
Send:
01 10 00 03 00 01 02 04 D2 CRC16
Address: DR03=0001
Receive:
Length: DR04=0002
01 10 00 01 00 02 CRC16
data storage: DRE0=1234(hex: 04D2),
DRE1=5678(hex: 162E)
Send: 01 10 00 01 00 02 04 04 D2 16 2E CRC16
4
Address: 0003
Receive: 01 01 02 data1 data2
Read coil
Length
≡
10H,
CRC16
Send: 01 01 00 03 00 10 CRC16
data storage:
DRE0= (data1<<8) | data2
Address: DR03=0001
Receive: 01 01 02 data1 data2
Length: DR04=0016
CRC16
Send: 01 01 00 01 00 10 CRC16
data storage:
Max value in DR04 is 400.
DRE0= (data1<<8) | data2
1
2
3
4
5