Modbus properties
Use the Modbus® properties to configure the mode of operation, master device settings, slave 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 Master
mode, you
can use only the Modbus TCP/IP Master Read and Modbus TCP/IP
Master Write blocks. Similarly, in the Slave
mode, you can use only the Modbus TCP/IP Slave Read and Modbus
TCP/IP Slave Write blocks.
Settings
Default:
Master
Slave
Remote Slave IP port number
Enter the IP port number of the master device connected on the TCP/IP network to
successfully communicate between the master and slave devices. For example, if the
remote slave device(s) are connected to port number 502
, the
master device must communicate only on this port with the slave device(s) for
establishing a successful communication.
Note
Specify the same port number for the Remote Slave IP port number and Local IP port number parameters for the master and slave device(s) to communicate successfully.
Settings
Default: 502
Positive integer
Dependencies
To enable this parameter, set Mode to
Master
.
Local IP port number
Enter the IP port number of the slave device(s) connected on the TCP/IP network to
successfully communicate between the master and slave device(s). For example, if the
master is connected to port number 502
, the slave device(s) must
communicate only on this port with the master device for establishing a successful
communication.
Note
Specify the same port number for the Remote Slave IP port number and Local IP port number parameters for the master and slave device(s) to communicate successfully.
Settings
Default: 502
Positive integer
Dependencies
To enable this parameter, set Mode to
Slave
.
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
Slave
.
Coil Register Parameters
Parameter | Description | Default Value |
---|---|---|
Start address | Starting address of the coil register. Dependencies: To enable this parameter, select Configure Coils. | 0 |
Quantity | Number 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
Slave
.
Discrete Input Register Parameters
Parameter | Description | Default Value |
---|---|---|
Start address | Starting address of the discrete input register. Dependencies: To enable this parameter, select Configure Discrete Inputs. | 0 |
Quantity | Number 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
Slave
.
Holding Register Parameters
Parameter | Description | Default Value |
---|---|---|
Start address | Starting address of the holding register. Dependencies: To enable this parameter, select Configure Holding registers. | 0 |
Quantity | Number 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
Slave
.
Input Register Parameters
Parameter | Description | Default Value |
---|---|---|
Start address | Starting address of the input register. Dependencies: To enable this parameter, select Configure Input registers. | 0 |
Quantity | Number 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 no longer valid.
Settings
Default: 100
Positive integer
Dependencies
To enable this parameter, set Mode to
Master
.