Main Content

Modbus properties

Use the Modbus® properties to configure the mode of operation, client device settings, server register settings, and remote and local IP port numbers.

You can use these parameters to configure the Modbus properties.

Communication Interface

Select the type of communication interface the Modbus blocks use for Modbus TCP/IP communication.

Settings

Default: TCP/IP

Mode

Select the Modbus mode of operation for the Simulink® model. This parameter also determines the type of blocks that can be used in the Simulink model. For example, in the Client mode, you can use only the Modbus TCP/IP Client Read and Modbus TCP/IP Client Write blocks. Similarly, in the Server mode, you can use only the Modbus TCP/IP Server Read and Modbus TCP/IP Server Write blocks.

Settings

Default: Client

Server

Remote Server IP port number

Enter the IP port number of the client device connected on the TCP/IP network to communicate between the client and server devices. For example, if the remote server device(s) are connected to port number 502, the client device must communicate only on this port with the server device(s) for establishing a successful communication.

Note

Specify the same port number for the Remote Server IP port number and Local IP port number parameters for the client and server device(s) to communicate successfully.

Settings

Default: 502

Positive integer

Dependencies

To enable this parameter, set Mode to Client.

Local IP port number

Enter the IP port number of the server device(s) connected on the TCP/IP network to communicate between the client and server device(s). For example, if the client is connected to port number 502, the server device(s) must communicate only on this port with the client device for establishing a successful communication.

Note

Specify the same port number for the Local IP port number and Remote Server IP port number parameters for the client and server device(s) to communicate successfully.

Settings

Default: 502

Positive integer

Dependencies

To enable this parameter, set Mode to Server.

Configure Coils

Select this parameter to configure the starting address and number of coil registers.

Settings

Default: Selected

Dependencies

To enable this parameter, set Mode to Server.

Coil Register Parameters

ParameterDescriptionDefault Value
Start addressStarting address of the coil register. Dependencies: To enable this parameter, select Configure Coils.0
QuantityNumber of coil registers. Dependencies: To enable this parameter, select Configure Coils.1

Configure Discrete Inputs

Select this parameter to configure the starting address and number of discrete input registers.

Settings

Default: Selected

Dependencies

To enable this parameter, set Mode to Server.

Discrete Input Register Parameters

ParameterDescriptionDefault Value
Start addressStarting address of the discrete input register. Dependencies: To enable this parameter, select Configure Discrete Inputs.0
QuantityNumber of discrete input registers. Dependencies: To enable this parameter, select Configure Discrete Inputs.1

Configure Holding registers

Select this parameter to configure the starting address and number of holding registers.

Settings

Default: Selected

Dependencies

To enable this parameter, set Mode to Server.

Holding Register Parameters

ParameterDescriptionDefault Value
Start addressStarting address of the holding register. Dependencies: To enable this parameter, select Configure Holding registers.0
QuantityNumber of holding registers. Dependencies: To enable this parameter, select Configure Holding registers.1

Configure Input registers

Select this parameter to configure the starting address and number of input registers.

Settings

Default: Selected

Dependencies

To enable this parameter, set Mode to Server.

Input Register Parameters

ParameterDescriptionDefault Value
Start addressStarting address of the input register. Dependencies: To enable this parameter, select Configure Input registers.0
QuantityNumber of input registers. Dependencies: To enable this parameter, select Configure Input registers.1

Received timeout (ms)

Enter the maximum time in milliseconds that the block should wait for a response from the Modbus server. If the Modbus server does not acknowledge the client within the specified time, then the communication is not valid.

Settings

Default: 100

Positive integer

Dependencies

To enable this parameter, set Mode to Client.