Peculiarities for accessing Modbus addresses

Peculiarities for bit access:

  • As you can see in the address table, a WORD in the %M area is assigned to each Modbus address 0000hex .. FFFFhex
  • Bit addresses 0000hex .. FFFFhex are contained in the word range %MW0.0 .. %MW0.4095

Write/read-protected areas for the Modbus client:

As described in the PLC configuration, one write-protected and one read-protected area can be defined for each segment line 0 and line 1. If you try to write to a write-protected area or to read from a read-protected area, an error message is generated.

Segment exceedance for line 0 and line 1:

A write- or read-protected area that lies in both segments, line 0 and line 1, cannot be accessed with a write/read operation. In case of a segment exceedance, an error message is generated.

Example:

Read 10 words beginning at address := 7FFEhex

This includes the addresses: 7FFEhex…8007hex with the operands %MW0.32766…%MW1.7. Because line 0 is exceeded in this case, an error message is generated.

Due to this, two telegrams have to be generated here:

1. Read 2 words beginning at address := 7FFEhex and

2. Read 8 words beginning at address := 8000hex.

Valid data areas for reading/writing the Modbus server:

If the AC500 control system operates as Modbus server, the data exchange with the Modbus clients is controlled using a MOD_MAST block (ETH_MOD_MAST: ETH_MOD_MAST ETH_MOD_MAST for Modbus on TCP/IP and COM_MOD_MAST: COM_MOD_MAST COM_MOD_MAST for serial interfaces).

The address of the area from which data are to be read or to which data are to be written is specified at block input “Data” via the ADR operator.

For the AC500, the following areas can be accessed using the ADR operator:

  • Inputs area (%I area)
  • Outputs area (%Q area)
  • Area of non-buffered variables (VAR .. END_VAR or VAR_GLOBAL END_VAR)
  • Addressable flag area (also protected areas for %M area)
  • Area of buffered variables (VAR RETAIN .. END_VAR or VAR_GLOBAL RETAIN .. END_VAR)