Main Content

Modbus RS485 Server Write

Server device writes data to server device register over RS485 network

Since R2020b

Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.

  • MODBUS RS485 Server Write

Libraries:
Simulink Support Package for Arduino Hardware / Common

Description

In the Modbus RS485 Server Write block, the server device writes data to its registers. The server can write data only to one register per write operation.

Simulink® Support Package for Arduino® Hardware supports the Modbus® communication protocol over the RS485 network. Each device on the RS485 network is referenced by a unique 8-bit address or identifier.

This table categories the server registers referenced by the Modbus server device.

Register TypeRegister Size
Coil1-bit
Discrete Input1-bit
Holding Register16-bit
Input Register16-bit

Ports

Input

expand all

The input to the block is the data to be written to its registers by the server as a 1-bit scalar.

  • If you select the Coil or Discrete Input write operations, the server writes data to its registers as a 1-bit write operation having the Boolean data type.

  • If you select the Holding Register or Input Register write operations, the server writes data to its registers as a 16-bit write operation having the uint16 data type.

Data Types: Boolean | uint16

Parameters

expand all

Select the type of write operation you want to perform on the server register. Specify any one of the following:

  • Write Coil: Write data to the coil register address specified in the Coil Address parameter

  • Write Discrete input: Write data to the discrete input register address specified in the Discrete Input Address parameter

  • Write Holding register: Write data to the holding register address specified in the Holding Register Address parameter

  • Write Input register: Write data to the input register address specified in the Input Register Address parameter

To notify the server to write data to a specific coil register, specify the coil register address in this parameter. For example, for the server to write data to the coil register with the address 10, enter 10.

Dependencies

To enable this parameter, set Function to Write Coil.

To notify the server to write data to a specific discrete input register, specify the discrete input register address in this parameter. For example, for the server to write data to the discrete input register with the address 80, enter 80.

Dependencies

To enable this parameter, set Function to Write Discrete input.

To notify the server to write data to a specific holding register, specify the holding register address in this parameter. For example, for the server to write data to the holding register with the address 37, enter 37.

Dependencies

To enable this parameter, set Function to Write Holding register.

To notify the server to write data to a specific input register, specify the input register address in this parameter. For example, for the server to write data to the input register with the address 25, enter 25.

Dependencies

To enable this parameter, set Function to Write Input register.

Version History

Introduced in R2020b