
To notify the client to read data from one discrete input register, specify its address in the Discrete Input Address parameter. Select the Read Discrete input option in the Function parameter. Ensure to configure the same server address as used in the MODBUS RS485 Server Write block for the discrete input register.
#Modbus server vs client generator#
You can configure the following parameters to read 1-bit pulse generator data from the discrete input register:Įnter the unique 8-bit server address of the identifier in the server address parameter. A lamp indicator is used to signify the 1-bit read from the discrete input register. This data is valid only if the status port value is 0, indicating a successful read operation and the presence of valid data on its data port.

The data read from the discrete input registers is available on the data port of the MODBUS Client Read block for the discrete input register. Four MODBUS RS485 Client Read blocks are used to implement the read operation on input and discrete input registers, respectively.Ī 1-bit pulse generator is used to write data to the discrete input registers. The client read operation is valid on all the server device registers (coil, holding, discrete input, and input). MODBUS Client Configuration for Read from Server Mode of Operation The default value is 0.Įnter 2 in the Number of Holding registers parameter.

To notify the client to write data to the holding registers, specify the address of the first coil register in the Holding Register Address parameter. Select the Write Multiple Holding registers option in the Function parameter. You can configure the following parameters to write data from the slider switches to the coil registers:Įnter the unique 8-bit server address of the identifier in the server address parameter. Three slider switches are used in this model, whose output is multiplexed and fed as an input to one of the MODBUS® RS485 Client Write blocks. The On position depicts that data 1 is written on these registers, whereas the Off position depicts that data 0 is written on these registers.

To perform the 1-bit write operation on the coil registers, change the position of the slider switches. This example uses two MODBUS RS485 Client Write blocks to implement the write operation on the coil registers and the holding registers, respectively. The client write operation is valid on coil and holding registers. MODBUS Client Configuration for Write to Server Mode of Operation The default values for the Simulink client model are preconfigured in this example depending on the server register size and the allowed client operations. The Simulink model for the client can be divided into two parts, Write to Server and Read from Server, based on the type of operation the client can perform on the server device registers.
