Modbus TCP/IP Slave Write
Server device writes data to server device register over TCP/IP network
Since R2022a
Libraries:
NVIDIA Jetson and NVIDIA DRIVE /
Network
Description
In the Modbus TCP/IP Server Write block, the server device writes data to its registers. The server can write data to only one register per read operation.
MATLAB® Coder™ Support Package for NVIDIA® Jetson™ and NVIDIA DRIVE® Platforms supports the Modbus® communication protocol over the TCP/IP network.
The server can perform read and write operation on these server register(s).
Register Type | Register Size |
---|---|
Coil | 1-bit |
Discrete Input | 1-bit |
Holding Register | 16-bit |
Input Register | 16-bit |
Ports
Input
Input — Input data
scalar
The input to the block is the data that the server writes to its registers 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 as Boolean data.
If you select the Holding Register or Input Register write operations, the server writes data to its registers as a 16-bit write operation as
uint16
data.
Data Types: Boolean
| uint16
Parameters
Function — Type of write operation
Write Coil
(default) | Write Discrete Input
| Write Holding register
| Write Input register
Select the type of write operation you want to perform on the server register. Specify any one of the following:
Value | Description |
---|---|
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. |
Programmatic Use
Block Parameter:
Function
|
Type: character vector |
Values:
'Write Coil' | 'Write Discrete Input' |
'Write Holding Register' | 'Write Input
Register' |
Default:
'Write Coil' |
Coil Address — Address of coil register
0
(default) | scalar
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
.
Programmatic Use
Block Parameter:
CoilAddress
|
Type: character vector |
Values:
'0' | scalar |
Default:
'0' |
Discrete Input Address — Address of discrete input register
0
(default) | scalar
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
.
Programmatic Use
Block Parameter:
DiscreteInputAddress
|
Type: character vector |
Values:
'0' | scalar |
Default:
'0' |
Holding Register Address — Address of holding register
0
(default) | scalar
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
.
Programmatic Use
Block Parameter:
HoldingRegisterAddress
|
Type: character vector |
Values:
'0' | scalar |
Default:
'0' |
Input Register Address — Address of input register
0
(default) | scalar
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
.
Programmatic Use
Block Parameter:
InputRegisterAddress
|
Type: character vector |
Values:
'0' | scalar |
Default:
'0' |
Version History
Introduced in R2022a
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)