Tab: Modbus TCP Slave Device – General

This tab contains the basic settings for network communication.

Configured Parameters

Watchdog

: Activates the watchdog function.

The incoming data (holding registers / %I range) is set to zero when the Modbus device does not receive any valid query from the master.

Closing the TCP socket

: If the watchdog is enabled and the set time is exceeded, then the TCP socket will be closed.

Slave port

Port number of the slave

Bind to Adapter

This option is relevant for systems with multiple Ethernet adapters.

: The server socket of the Modbus slave is bound to the IP address of the assigned Ethernet adapter. Only Modbus requests which have been sent to this IP address are received.

: The server socket of the Modbus Slave is not bound to an IP address. All Modbus requests are processed, which have been received by the system (on the Modbus port).

Holding registers (%IW)

Number of holding registers: possible values: 1–4096. The maximum number can be limited in the device description.

Writable: : For the holding register, writable I/O mappings (%QW addresses) are generated instead of read-only I/O mappings (%IW addresses). This allows the holding registers to be set by the Modbus device application (= server application) by means of the usual I/O mapping.

Input registers (%QW)

Number of input registers: possible values: 1–4096. The maximum number can be limited in the device description.

Discrete Bit Areas

The Modbus coils and discrete inputs get their own data area. By default, the register access and bit access use the same Modbus data.

Coils

Number of Modbus coils

Discrete inputs

Number of Modbus discrete inputs

IMPORTANT:

Changes to the input/output assembly size have a direct effect on the number of configurable parameters in the I/O mapping.

Data Model

Modbus defines for I/O data a data model with four areas.

  • Coils: Outputs of type BIT

  • Discrete inputs: Inputs of type BYTE

  • Holding register: Outputs of type WORD (16-bit)

  • Input register: Inputs of type WORD (16-bit)

Inputs and outputs are included as with all fieldbuses, but from the point of view of the "host". These data areas have any number of logical start offsets as defined by the manufacturer. The I/O data behind the Modbus data areas can overlap or be independent of each other.

For details about the Modbus data model, see Modbus Protocol Specification in Chapters 4.3 and 4.4 (www.modbus.org).

In the case of the CODESYS Modbus Device, the input registers and discrete inputs, as well as the holding registers and coils, are all mapped to the same I/O data. This is also the case when they are addressed via different logical start offsets.

Coils

Definition of the start address of the respective Modbus data area

Discrete inputs

Holding register

Input register

Holding and input register data areas overlay

: Overlay of the process image by the holding and input register.

This is required, for example, when the slave application is used to write to the holding register.