地址

5.3. Address
Addresses in the Modbus protocol are confusing! Some protocol specifications use the protocol/message address and others use device addressing.

5.3.1. Protocol/message address
Some protocol specifications use the protocol/message address counting from 0 to 65535 along with a function code. This is also what the new Modbus specifications use. This is the address inside the message sent on the wire.

*# Modbus Poll use protocol/message address counting from 0 to 65535. #*

5.3.2. Device address
Some protocol specifications use device address/registers. Registers counts from 1. The first digit describes the function to be used. That means the device address 40101 is identified by address 100. The “4” means Holding registers and 4x registers counts from 1. And even more confusing: 4x means function code 03 and 3x means function code 04!

5.3.3. 5 digits vs. 6 digits addressing
The address format 4x counts from 40001 to 49999. The next address is not 50000. In old days 9999 addresses was enough. There are cases where 9999 is not enough. Then a zero is added. 40101 become 400101 and so on. This is called 6 digits addressing or extended addressing.

This is not a problem with Modbus Poll. 410001 become 10000. The “4” is thrown away and the rest 10001 is decremented by 1 as we count from 0 instead of 1.

5.4. Address examples
These examples show how to setup Modbus Poll if a specification use device addresses.

5.4.1. Read Holding Registers
You want to read 20 registers from device address 40011 from slave ID 2 every 1000ms. From the “4” we know this is function 03 “Read Holding Registers”.

Slave ID = 2

Function = ”03 Read Holding Registers (4x)”

Address = 10 (11 minus 1)

Quantity = 20

Scan rate = 1000

存储容量

对于一个AC500,可以使用Modbus寻址的范围是65536个Word,所以一共有655362=131072个字节,131072个字节=1281024=128k字节

Zenon Modbus

Read and write requests sent by MODBUS masters will be denied if the range specified in the request does not fit within a data block defined in the configuration. Requests overlapping two data blocks will be denied. For example, if you configure a block of 16 words starting at address 1 and another block of 16 words starting at address 17, a request for read or write of 32 words starting at address 1 will be denied and an “address error” exception will be reported.